summaryrefslogtreecommitdiff
path: root/gc_cpp.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gc_cpp.cc')
-rw-r--r--gc_cpp.cc18
1 files changed, 15 insertions, 3 deletions
diff --git a/gc_cpp.cc b/gc_cpp.cc
index a97091c..49dc662 100644
--- a/gc_cpp.cc
+++ b/gc_cpp.cc
@@ -26,8 +26,6 @@ Authors: John R. Ellis and Jesse Hull
#include "gc_cpp.h"
-#ifndef _MSC_VER
-/* In the Visual C++ case, we moved this into the header. */
void* operator new( size_t size ) {
return GC_MALLOC_UNCOLLECTABLE( size );}
@@ -44,6 +42,20 @@ void operator delete[]( void* obj ) {
#endif /* OPERATOR_NEW_ARRAY */
-#endif /* _MSC_VER */
+#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 */