htop/debug.h

29 lines
674 B
C
Raw Normal View History

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__)
#define debug_done() DebugMemory_report()
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
#define debug_done() sleep(0)
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
#define debug_done() sleep(0)
2006-03-04 18:16:49 +00:00
#endif
2006-05-30 14:26:30 +00:00