summaryrefslogtreecommitdiff
path: root/gc_cpp.cc
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2011-07-26 17:07:21 +0400
committerIvan Maidanski <ivmai@mail.ru>2011-07-26 17:07:21 +0400
commit3313dcc53de4d5d5f76f58a856beb06688d1f8c7 (patch)
tree112d67f2a8b062a9e238469308394e762e26e2f5 /gc_cpp.cc
parent9f27ae7aee7a12b3c99d0ce7dc4c7384e3189fa2 (diff)
downloadbdwgc-3313dcc53de4d5d5f76f58a856beb06688d1f8c7.tar.gz
gc6.1alpha4 tarball importgc6_1alpha4
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 a97091c8..49dc6620 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 */