--- parser3/src/include/pa_memory.h 2005/11/25 11:11:26 1.13 +++ parser3/src/include/pa_memory.h 2007/05/07 09:47:07 1.16 @@ -9,17 +9,11 @@ #ifndef PA_MEMORY_H #define PA_MEMORY_H -static const char * const IDENT_MEMORY_H="$Date: 2005/11/25 11:11:26 $"; +static const char * const IDENT_MEMORY_H="$Date: 2007/05/07 09:47:07 $"; // include #include "pa_config_includes.h" - -/// to debug backtrace pointers switch this on: -#ifdef _DEBUG -// this switches on straightforward realloc implementation, bad for profiling -//#define GC_DEBUG -#endif #include "gc.h" // defines @@ -83,9 +77,13 @@ inline void *pa_realloc(void *ptr, size_ return pa_fail_alloc("reallocate to", size); } -//{@ these operators are disabled, one should explicitely specify either new(UseGC) or new(PointerFreeGC) -inline void *operator new(size_t) { abort(); } // disabled -inline void *operator new[] (size_t) { abort(); } // disabled +//{@ these operators can be used from stl. to be on a safe side, assume that data may contain pointers +inline void *operator new[] (size_t size) { + return pa_malloc(size); +} +inline void *operator new(size_t size) { + return pa_malloc(size); +} //}@ #define UseGC ((int)1)