23 void* gu_malloc_dbg (
size_t size,
24 const char* file,
unsigned int line);
25 void* gu_calloc_dbg (
size_t nmemb,
size_t size,
26 const char* file,
unsigned int line);
27 void* gu_realloc_dbg (
void* ptr,
size_t size,
28 const char* file,
unsigned int line);
29 void gu_free_dbg (
void* ptr,
30 const char* file,
unsigned int line);
35 void gu_mem_stats (ssize_t* total, ssize_t* allocs, ssize_t* reallocs,
42 #define gu_malloc(S) gu_malloc_dbg ((S), __FILE__, __LINE__)
43 #define gu_calloc(N,S) gu_calloc_dbg ((N), (S), __FILE__, __LINE__)
44 #define gu_realloc(P,S) gu_realloc_dbg ((P), (S), __FILE__, __LINE__)
45 #define gu_free(P) gu_free_dbg ((P), __FILE__, __LINE__)
49 #define gu_malloc(S) malloc ((S))
50 #define gu_calloc(N,S) calloc ((N), (S))
51 #define gu_realloc(P,S) realloc ((P), (S))
52 #define gu_free(P) free ((P))
57 #define GU_MALLOC(type) (type*) gu_malloc (sizeof(type))
58 #define GU_MALLOCN(N,type) (type*) gu_malloc ((N) * sizeof(type))
59 #define GU_CALLOC(N,type) (type*) gu_calloc ((N), sizeof(type))
60 #define GU_REALLOC(P,N,type) (type*) gu_realloc((P), (N) * sizeof(type))
void gu_mem_stats(ssize_t *total, ssize_t *allocs, ssize_t *reallocs, ssize_t *deallocs)
Definition: gu_mem.c:155