--- parser3/src/include/pa_memory.h 2003/11/06 09:56:17 1.7 +++ parser3/src/include/pa_memory.h 2005/11/25 11:11:26 1.13 @@ -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,7 +9,7 @@ #ifndef PA_MEMORY_H #define PA_MEMORY_H -static const char* IDENT_MEMORY_H="$Date: 2003/11/06 09:56:17 $"; +static const char * const IDENT_MEMORY_H="$Date: 2005/11/25 11:11:26 $"; // include @@ -17,7 +17,8 @@ static const char* IDENT_MEMORY_H="$Date /// to debug backtrace pointers switch this on: #ifdef _DEBUG -#define GC_DEBUG +// this switches on straightforward realloc implementation, bad for profiling +//#define GC_DEBUG #endif #include "gc.h" @@ -63,7 +64,7 @@ inline char *pa_strdup(const char* auto_ size_t size=known_length+1; if(char *result=static_cast(pa_gc_malloc_atomic(size))) { - memcpy(result, auto_variable_never_null, size); + memcpy(result, auto_variable_never_null, known_length); result[known_length]=0; return result; }