]> git.ipfire.org Git - thirdparty/gcc.git/blobdiff - boehm-gc/gc_cpp.cc
re PR target/78594 (Bug in November 11th, 2016 change to rs6000.md)
[thirdparty/gcc.git] / boehm-gc / gc_cpp.cc
index a766a01a328ce168f14db6d04f90c27e4f27adb5..f8b803a8baa42a1f59583e48cd7120866be31090 100644 (file)
@@ -32,8 +32,7 @@ void* operator new( size_t size ) {
 void operator delete( void* obj ) {
     GC_FREE( obj );}
   
-
-#ifdef OPERATOR_NEW_ARRAY
+#ifdef GC_OPERATOR_NEW_ARRAY
 
 void* operator new[]( size_t size ) {
     return GC_MALLOC_UNCOLLECTABLE( size );}
@@ -41,6 +40,22 @@ void* operator new[]( size_t size ) {
 void operator delete[]( void* obj ) {
     GC_FREE( obj );}
 
-#endif /* OPERATOR_NEW_ARRAY */
+#endif /* GC_OPERATOR_NEW_ARRAY */
+
+#ifdef _MSC_VER
+
+// This new operator is used by VC++ in case of Debug builds !
+void* operator new( size_t size,
+                         int ,//nBlockUse,
+                         const char * szFileName,
+                         int nLine )
+{
+#ifndef GC_DEBUG
+       return GC_malloc_uncollectable( size );
+#else
+       return GC_debug_malloc_uncollectable(size, szFileName, nLine);
+#endif
+}
 
+#endif /* _MSC_VER */