--- parser3/src/main/pa_memory.C 2003/03/18 11:54:56 1.1.2.5 +++ parser3/src/main/pa_memory.C 2003/03/20 13:09:54 1.1.2.5.2.3 @@ -5,32 +5,19 @@ Author: Alexandr Petrosian (http://paf.design.ru) */ -static const char* IDENT_MEMORY_C="$Date: 2003/03/18 11:54:56 $"; +static const char* IDENT_MEMORY_C="$Date: 2003/03/20 13:09:54 $"; -#include "pa_pool.h" -#include "pa_exception.h" -#include "pa_common.h" #include "pa_sapi.h" -#ifdef PA_DEBUG_REFERENCES -//#include "../lib/stacktrace/stacktrace.h" -#include "../lib/stackdumper/include/stackdumper.h" - -const void *refdbg_this=(const void *)0x0132bd20/*$object[<<<^engine::parser[]], Junction::this of method @process_4_main with leak = 0x01356bb0*/; //0x013055a0; //0; -StackDumper sd(true); - -void pa_stack_dump(const char *msg) { - // Run a stack trace, skip the assert call (passing 1) -// char *stackMsg = stackTraceAndGetString(); -// printf("%s\n", stackMsg); - sd.DumpStack(); - sd.puts(msg); -} -#endif - -void *pa_fail_alloc(char *what, size_t size) { - SAPI::abort("out of memory: failed to %s %u bytes", - what, size); +void *pa_fail_alloc(const char* what, size_t size) { + SAPI::abort("out of memory: failed to %s %u bytes. " + "heap_used=%lu, heap_free=%lu, bytes_since_gc=%lu, total_bytes=%lu", + what, size, + GC_get_heap_size(), + GC_get_free_bytes(), + GC_get_bytes_since_gc(), + GC_get_total_bytes() + ); // never reached return 0;