--- parser3/src/include/pa_memory.h 2004/01/29 13:50:21 1.9 +++ parser3/src/include/pa_memory.h 2006/04/09 13:38:47 1.15 @@ -1,7 +1,7 @@ /** @file Parser: memory reference counting classes decls. - Copyright (c) 2001-2003 ArtLebedev Group (http://www.artlebedev.com) + Copyright (c) 2001-2005 ArtLebedev Group (http://www.artlebedev.com) Author: Alexandr Petrosian (http://paf.design.ru) */ @@ -9,16 +9,11 @@ #ifndef PA_MEMORY_H #define PA_MEMORY_H -static const char * const IDENT_MEMORY_H="$Date: 2004/01/29 13:50:21 $"; +static const char * const IDENT_MEMORY_H="$Date: 2006/04/09 13:38:47 $"; // include #include "pa_config_includes.h" - -/// to debug backtrace pointers switch this on: -#ifdef _DEBUG -#define GC_DEBUG -#endif #include "gc.h" // defines @@ -61,7 +56,8 @@ inline void *pa_malloc_atomic(size_t siz inline char *pa_strdup(const char* auto_variable_never_null, size_t helper_length=0) { size_t known_length=(helper_length?helper_length:strlen(auto_variable_never_null)); - if(char *result=static_cast(pa_gc_malloc_atomic(known_length+1))) { + size_t size=known_length+1; + if(char *result=static_cast(pa_gc_malloc_atomic(size))) { memcpy(result, auto_variable_never_null, known_length); result[known_length]=0; return result; @@ -82,8 +78,8 @@ inline void *pa_realloc(void *ptr, 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 +inline void *operator new(size_t) { abort(); return /*calm, compiler*/ (void*)1; } // disabled +inline void *operator new[] (size_t) { abort(); return /*calm, compiler*/ (void*)1; } // disabled //}@ #define UseGC ((int)1)