2006-03-04 18:16:49 +00:00
|
|
|
|
2006-05-30 14:26:30 +00:00
|
|
|
#if defined(DEBUG)
|
2006-03-04 18:16:49 +00:00
|
|
|
|
2006-05-30 14:26:30 +00:00
|
|
|
/* Full debug */
|
|
|
|
#include "DebugMemory.h"
|
2006-06-06 20:28:42 +00:00
|
|
|
#define calloc(a, b) DebugMemory_calloc(a, b, __FILE__, __LINE__)
|
|
|
|
#define malloc(x) DebugMemory_malloc(x, __FILE__, __LINE__, #x)
|
|
|
|
#define realloc(x,s) DebugMemory_realloc(x, s, __FILE__, __LINE__, #x)
|
|
|
|
#define strdup(x) DebugMemory_strdup(x, __FILE__, __LINE__)
|
|
|
|
#define free(x) DebugMemory_free(x, __FILE__, __LINE__)
|
2011-11-18 06:08:56 +00:00
|
|
|
#define debug_done() DebugMemory_report(); _nc_freeall()
|
2006-03-04 18:16:49 +00:00
|
|
|
|
2006-05-30 14:26:30 +00:00
|
|
|
#elif defined(DEBUGLITE)
|
2006-03-04 18:16:49 +00:00
|
|
|
|
2006-05-30 14:26:30 +00:00
|
|
|
/* Assertions and core only */
|
|
|
|
#ifdef NDEBUG
|
|
|
|
#undef NDEBUG
|
|
|
|
#endif
|
2011-09-08 01:01:44 +00:00
|
|
|
#define debug_done()
|
2006-03-04 18:16:49 +00:00
|
|
|
|
2006-05-30 14:26:30 +00:00
|
|
|
#else
|
2006-03-04 18:16:49 +00:00
|
|
|
|
2006-05-30 14:26:30 +00:00
|
|
|
/* No debugging */
|
|
|
|
#define NDEBUG
|
2011-09-08 01:01:44 +00:00
|
|
|
#define debug_done()
|
2006-03-04 18:16:49 +00:00
|
|
|
|
|
|
|
#endif
|
2006-05-30 14:26:30 +00:00
|
|
|
|