summaryrefslogtreecommitdiff
path: root/src/common/malloc.h
diff options
context:
space:
mode:
authorflaviojs <flaviojs@54d463be-8e91-2dee-dedb-b68131a5f0ec>2011-07-20 22:23:13 +0000
committerflaviojs <flaviojs@54d463be-8e91-2dee-dedb-b68131a5f0ec>2011-07-20 22:23:13 +0000
commit427ebfd9e94a68ca15ca6b51378b80871dde95b9 (patch)
treee2570ffea4a7399fafed9459aa4dbddd2410e439 /src/common/malloc.h
parent0c750e8a43af3e68d000ba9009dce8dc8a2d9769 (diff)
downloadhercules-427ebfd9e94a68ca15ca6b51378b80871dde95b9.tar.gz
hercules-427ebfd9e94a68ca15ca6b51378b80871dde95b9.tar.bz2
hercules-427ebfd9e94a68ca15ca6b51378b80871dde95b9.tar.xz
hercules-427ebfd9e94a68ca15ca6b51378b80871dde95b9.zip
* 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
Diffstat (limited to 'src/common/malloc.h')
-rw-r--r--src/common/malloc.h12
1 files changed, 3 insertions, 9 deletions
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);