/* Smartalloc.h Copyright Clinton Staley 1991 * modified by ceh 1992 * modified by bkm 1992 */ #ifndef _SALLOC_H #define _SALLOC_H extern void *smartalloc(unsigned int bytes, char *file, int line, int fill); extern void *smartrealloc(void *old, unsigned int bytes, char *file, int line, int fill); extern char *smartdup(const char *oldstr, char *file, int line, int fill); extern void smartfree(void *data, char *file, int line); extern long report_offenders(long min); extern void chk_tromp(char *file, int line); #ifdef MDEBUG #define malloc(x) smartalloc((x), __FILE__, __LINE__, 0xAA) #define calloc(x, y) smartalloc((x)*(y), __FILE__, __LINE__, 0) #define realloc(x, y) smartrealloc((x), (y), __FILE__, __LINE__, 0xBB) #define strdup(x) smartdup((x), __FILE__, __LINE__, 0xBB) #define free(x) smartfree((x), __FILE__, __LINE__) #define check_tromp() chk_tromp(__FILE__, __LINE__) #define report_space() report_offenders(-1) #else #include #define check_tromp() #define report_space() #define report_offenders() #endif #endif