--- deliantra/server/include/util.h 2008/04/15 03:16:02 1.68 +++ deliantra/server/include/util.h 2008/04/20 06:20:38 1.71 @@ -22,8 +22,9 @@ #ifndef UTIL_H__ #define UTIL_H__ -#define DEBUG_SALLOC 0 -#define PREFER_MALLOC 1 +#define DEBUG_POISON 0x00 // poison memory before freeing it if != 0 +#define DEBUG_SALLOC 0 // add a debug wrapper around all sallocs +#define PREFER_MALLOC 0 // use malloc and not the slice allocator #if __GNUC__ >= 3 # define is_constant(c) __builtin_constant_p (c) @@ -219,6 +220,7 @@ if (expect_true (ptr)) { slice_alloc -= n * sizeof (T); + if (DEBUG_POISON) memset (ptr, DEBUG_POISON, n * sizeof (T)); g_slice_free1 (n * sizeof (T), (void *)ptr); assert (slice_alloc >= 0);//D }