From 3379238e443843670f9bbe3089346735cb97a372 Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Mon, 4 May 2015 20:28:24 +0300 Subject: [PATCH] Restore definition of new/delete operators in gc_cpp.cc (for non-VC) (revert part of commit 3d784ed) * gc_cpp.cc (new, delete, new[], delete[]): Add definition (unless _MSC_VER defined). Conflicts: gc_cpp.cc --- gc_cpp.cc | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/gc_cpp.cc b/gc_cpp.cc index 5cf305e0..78b4eeda 100644 --- a/gc_cpp.cc +++ b/gc_cpp.cc @@ -42,3 +42,27 @@ built-in "new" and "delete". # define GC_DECL_NEW_THROW /* empty */ # define GC_DECL_DELETE_THROW /* empty */ #endif /* !GC_NEW_DELETE_NEED_THROW */ + +#ifndef _MSC_VER + + void* operator new(size_t size) GC_DECL_NEW_THROW { + return GC_MALLOC_UNCOLLECTABLE(size); + } + +# if !defined(__CYGWIN__) + void operator delete(void* obj) GC_DECL_DELETE_THROW { + GC_FREE(obj); + } +# endif // !__CYGWIN__ + +# ifdef GC_OPERATOR_NEW_ARRAY + void* operator new[](size_t size) GC_DECL_NEW_THROW { + return GC_MALLOC_UNCOLLECTABLE(size); + } + + void operator delete[](void* obj) GC_DECL_DELETE_THROW { + GC_FREE(obj); + } +# endif // GC_OPERATOR_NEW_ARRAY + +#endif // !_MSC_VER -- 2.40.0