 |
NetBurner 3.1
|
5 #ifndef _DEBUG_ALLOC_H_ 6 #define _DEBUG_ALLOC_H_ 38 #define NB_DEBUG_ALLOC_LOG_SIZE (2048) 41 #define NB_DEBUG_ALLOC_GUARD_SIZE (64) 44 #define NB_DEBUG_ALLOC_GUARD_VALUE (0xA5) 85 void *mallocDebug(
size_t byteCount,
const char *caller,
int line);
86 void *callocDebug(
size_t elementCount,
size_t byteCount,
const char *caller,
int line);
87 void *reallocDebug(
void *ptr,
size_t byteCount,
const char *caller,
int line);
88 void freeDebug(
void *ptr,
const char *caller,
int line);
106 void printAllocDebugLog(
void);
107 void printAllocDebugLogAll(
void);
116 #ifdef NB_DEBUG_ALLOC_SUPPORTED 117 #define NBMALLOC(bYtEcOuNt) mallocDebug(bYtEcOuNt, __FUNCTION__, __LINE__); 118 #define NBCALLOC(eLeMeNtCoUnT, bYtEcOuNt) callocDebug(eLeMeNtCoUnT, bYtEcOuNt, __FUNCTION__, __LINE__); 119 #define NBREALLOC(pTr, bYtEcOuNt) reallocDebug(pTr, bYtEcOuNt, __FUNCTION__, __LINE__); 120 #define NBFREE(pTr) freeDebug(pTr, __FUNCTION__, __LINE__); 122 #define NBMALLOC(bYtEcOuNt) malloc(bYtEcOuNt); 123 #define NBCALLOC(eLeMeNtCoUnT, bYtEcOuNt) calloc(eLeMeNtCoUnT, bYtEcOuNt); 124 #define NBREALLOC(pTr, bYtEcOuNt) realloc(pTr, bYtEcOuNt); 125 #define NBFREE(pTr) free(pTr);