Go to the source code of this file.
Defines | |
| #define | CALLOC(nmemb, size) gift_calloc(nmemb,size) |
| #define | MALLOC(size) CALLOC(1,size) |
| #define | NEW(type) MALLOC(sizeof(type)) |
| #define | FREE(ptr) gift_free(ptr) |
| #define | REALLOC(ptr, size) gift_realloc(ptr,size) |
Functions | |
| EXTERN_C_BEGIN LIBGIFT_EXPORT void * | gift_malloc (size_t size) |
| LIBGIFT_EXPORT void * | gift_calloc (size_t nmemb, size_t size) |
| LIBGIFT_EXPORT void | gift_free (void *ptr) |
| LIBGIFT_EXPORT void * | gift_realloc (void *ptr, size_t size) |
| LIBGIFT_EXPORT void * | gift_memdup (const void *ptr, size_t size) |
|
||||||||||||
|
Wrapper for calloc to prevent nmemb 0 or size 0. |
|
|
Dummy wrapper for free to just go along with this scheme. |
|
|
Wrapper for malloc that prevents malloc(0). |
|
||||||||||||
|
Similar to strdup, except that it operates on raw memory. I'm baffled why such a function was not provided by the standard. |
|
||||||||||||
|
Realloc wrapper that prevents some broken implementations of realloc from failing when ptr is NULL or size is 0. |
1.3.7