diff options
author | Johannes Totz <jtotz@ic.ac.uk> | 2010-07-13 15:14:53 +0100 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2015-05-11 19:00:05 +0300 |
commit | 3d784edf71be4d0eb24db3b003a906b63be6aa7a (patch) | |
tree | 5e92697eb8ebbf4ad4dfe532d23e23b39147958f /gc_cpp.cc | |
parent | 59f7dff85b3cce6b1f0eec8704a2e98383530057 (diff) | |
download | bdwgc-3d784edf71be4d0eb24db3b003a906b63be6aa7a.tar.gz |
put all the cpp stuff in header
otherwise vc9 will mix up new and delete operators (due to arbitrary ordering during linking)
Conflicts:
gc_cpp.cc
include/gc_cpp.h
Diffstat (limited to 'gc_cpp.cc')
-rw-r--r-- | gc_cpp.cc | 84 |
1 files changed, 41 insertions, 43 deletions
@@ -43,46 +43,44 @@ built-in "new" and "delete". # define GC_DECL_DELETE_THROW /* empty */ #endif /* !GC_NEW_DELETE_NEED_THROW */ -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 */ - -#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 ) GC_DECL_NEW_THROW - { -# ifndef GC_DEBUG - return GC_malloc_uncollectable(size); -# else - return GC_debug_malloc_uncollectable(size, szFileName, nLine); -# endif - } - -# if _MSC_VER > 1020 - // This new operator is used by VC++ 7.0 and later in Debug builds. - void* operator new[]( size_t size, int nBlockUse, - const char* szFileName, int nLine ) GC_DECL_NEW_THROW - { - return operator new(size, nBlockUse, szFileName, nLine); - } -# endif - -#endif /* _MSC_VER */ +// MOVED TO HEADER! +//void* operator new( size_t size ) { +// return GC_MALLOC_UNCOLLECTABLE( size );} +// +//void operator delete( void* obj ) { +// GC_FREE( obj );} +// +//#ifdef GC_OPERATOR_NEW_ARRAY +// +//void* operator new[]( size_t size ) { +// return GC_MALLOC_UNCOLLECTABLE( size );} +// +//void operator delete[]( void* obj ) { +// GC_FREE( obj );} +// +//#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 +//} +// +//#if _MSC_VER > 1020 +//// This new operator is used by VC++ 7.0 and later in Debug builds. +//void* operator new[](size_t size, int nBlockUse, const char* szFileName, int nLine) +//{ +// return operator new(size, nBlockUse, szFileName, nLine); +//} +//#endif +// +//#endif /* _MSC_VER */ |