Added the debugging realloc() function.

This commit is contained in:
Robert James Kaes committed 2001-09-11 19:27:27 +00:00
1 parent 2c3cc9185d
commit e2f10bc2ea
2 files changed
+12 -2

No files matched your search

+4 -1
View File
@@ -1,4 +1,4 @@
/* $Id: utils.h,v 1.7 2001-09-08 18:55:58 rjkaes Exp $
/* $Id: utils.h,v 1.8 2001-09-11 19:27:27 rjkaes Exp $
*
* See 'utils.h' for a detailed description.
*
@@ -42,13 +42,16 @@ extern size_t strlcpy(char *dst, const char *src, size_t size);
extern void *debugging_calloc(size_t nmemb, size_t size, const char *file, unsigned long line);
extern void *debugging_malloc(size_t size, const char *file, unsigned long line);
extern void debugging_free(void *ptr, const char *file, unsigned long line);
extern void *debugging_realloc(void *ptr, size_t size, const char *file, unsigned long line);
# define safecalloc(x, y) debugging_calloc(x, y, __FILE__, __LINE__)
# define safemalloc(x) debugging_malloc(x, __FILE__, __LINE__)
# define saferealloc(x, y) debugging_realloc(x, y, __FILE__, __LINE__)
# define safefree(x) debugging_free(x, __FILE__, __LINE__)
#else
# define safecalloc(x, y) calloc(x, y)
# define safemalloc(x) malloc(x)
# define saferealloc(x, y) realloc(x, y)
# define safefree(x) free(x)
#endif