libchat6
lc6_debug.h
1 #ifdef LC6_DEBUG
2 
3 #ifndef LC6_DEBUG_H
4 #define LC6_DEBUG_H
5 
6 // DO NOT include the common.h here.
7 // because we're overriding functions
8 // #include "../inc/lc6_common.h"
9 
10 void* lc6debug_malloc(size_t, char *, const char*, int);
11 void* lc6debug_realloc(void *ptr, size_t, char *, const char*, int);
12 void lc6debug_free(void *ptr, char *, const char*, int);
13 
14 #define malloc(x) lc6debug_malloc(x, __FILE__, __func__, __LINE__)
15 #define realloc(x,y) lc6debug_realloc(x, y, __FILE__, __func__, __LINE__)
16 #define free(x) lc6debug_free(x, __FILE__, __func__, __LINE__)
17 
18 #endif
19 
20 #endif