]> granicus.if.org Git - gc/commitdiff
Restore definition of new/delete operators in gc_cpp.cc (for non-VC)
authorIvan Maidanski <ivmai@mail.ru>
Mon, 4 May 2015 17:28:24 +0000 (20:28 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Mon, 11 May 2015 16:10:55 +0000 (19:10 +0300)
(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

index 5cf305e014a16b78983502ee10656d7aa9a5d442..78b4eeda7a75ffeff944558aaf214164ba63944c 100644 (file)
--- 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