--- parser3/src/include/pa_memory.h 2005/11/25 11:11:26 1.13 +++ parser3/src/include/pa_memory.h 2009/04/18 00:33:34 1.17 @@ -1,7 +1,7 @@ /** @file Parser: memory reference counting classes decls. - Copyright (c) 2001-2005 ArtLebedev Group (http://www.artlebedev.com) + Copyright (c) 2001-2009 ArtLebedev Group (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ @@ -9,21 +9,18 @@ #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: 2009/04/18 00:33:34 $"; // 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 +// use destructors for Array, Hash and VMethodFrame +#define USE_DESTRUCTORS + //#define PA_DEBUG_GC_MEMORY #ifdef PA_DEBUG_GC_MEMORY @@ -83,9 +80,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)