From: Ivan Maidanski Date: Mon, 4 May 2015 17:28:24 +0000 (+0300) Subject: Restore definition of new/delete operators in gc_cpp.cc (for non-VC) X-Git-Tag: gc7_6_0~199^2~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3379238;p=gc 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 --- 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