GCS
0.2.3
|
#include <stdlib.h>
#include <unistd.h>
Go to the source code of this file.
Macros | |
Applications should use the following macros | |
#define | gu_malloc(S) malloc ((S)) |
#define | gu_calloc(N, S) calloc ((N), (S)) |
#define | gu_realloc(P, S) realloc ((P), (S)) |
#define | gu_free(P) free ((P)) |
#define | GU_MALLOC(type) (type*) gu_malloc (sizeof(type)) |
#define | GU_MALLOCN(N, type) (type*) gu_malloc ((N) * sizeof(type)) |
#define | GU_CALLOC(N, type) (type*) gu_calloc ((N), sizeof(type)) |
#define | GU_REALLOC(P, N, type) (type*) gu_realloc((P), (N) * sizeof(type)) |
Functions | |
void | gu_mem_stats (ssize_t *total, ssize_t *allocs, ssize_t *reallocs, ssize_t *deallocs) |
Functions to help with dynamic allocation debugging. | |
Take additional FILE and LINE arguments. Should be used as part of macros defined below | |
void * | gu_malloc_dbg (size_t size, const char *file, unsigned int line) |
void * | gu_calloc_dbg (size_t nmemb, size_t size, const char *file, unsigned int line) |
void * | gu_realloc_dbg (void *ptr, size_t size, const char *file, unsigned int line) |
void | gu_free_dbg (void *ptr, const char *file, unsigned int line) |
Declarations of memory allocation functions and macros
#define GU_MALLOC | ( | type | ) | (type*) gu_malloc (sizeof(type)) |
Convenience macros - to avoid code clutter
void gu_mem_stats | ( | ssize_t * | total, |
ssize_t * | allocs, | ||
ssize_t * | reallocs, | ||
ssize_t * | deallocs | ||
) |
Reports statistics on the current amount of allocated memory total number of allocations and deallocations