From 427ebfd9e94a68ca15ca6b51378b80871dde95b9 Mon Sep 17 00:00:00 2001 From: flaviojs Date: Wed, 20 Jul 2011 22:23:13 +0000 Subject: * Made GCOLLECT use it's debug functions. * Turned off garbage collection for GCOLLECT since there's nothing to do with explicit frees. * Added malloc_verify_ptr/malloc_usage code for all memory libraries. * Added malloc_memory_check for debug purposes, tests memory for errors and memory leaks. * Added explicit memory check on malloc_final. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14917 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/common/malloc.h | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'src/common/malloc.h') diff --git a/src/common/malloc.h b/src/common/malloc.h index e565b4eb0..5f8191d92 100644 --- a/src/common/malloc.h +++ b/src/common/malloc.h @@ -6,20 +6,13 @@ #include "../common/cbasetypes.h" -// Q: What are the 'a'-variant allocation functions? -// A: They allocate memory from the stack, which is automatically -// freed when the invoking function returns. -// But it's not portable (http://c-faq.com/malloc/alloca.html) -// and I have doubts our implementation works. -// -> They should NOT be used, period. - #define ALC_MARK __FILE__, __LINE__, __func__ -// default memory manager +// default use of the built-in memory manager #if !defined(NO_MEMMGR) && !defined(USE_MEMMGR) #if defined(MEMWATCH) || defined(DMALLOC) || defined(GCOLLECT) -// disable built-in memory manager when using another manager +// disable built-in memory manager when using another memory library #define NO_MEMMGR #else // use built-in memory manager by default @@ -95,6 +88,7 @@ //////////////////////////////////////////////// +void malloc_memory_check(void); bool malloc_verify_ptr(void* ptr); size_t malloc_usage (void); void malloc_init (void); -- cgit v1.2.3-60-g2f50