12 const char *file,
int line);
13extern void *
Mem_calloc(
long count,
long nbytes,
14 const char *file,
int line);
16 const char *file,
int line);
18 const char *file,
int line);
19#define ALLOC(nbytes) \
20 Mem_alloc((nbytes), __FILE__, __LINE__)
21#define CALLOC(count, nbytes) \
22 Mem_calloc((count), (nbytes), __FILE__, __LINE__)
23#define NEW(p) ((p) = ALLOC((long)sizeof *(p)))
24#define NEW0(p) ((p) = CALLOC(1, (long)sizeof *(p)))
25#define FREE(ptr) ((void)(Mem_free((ptr), \
26 __FILE__, __LINE__), (ptr) = 0))
27#define RESIZE(ptr, nbytes) ((ptr) = Mem_resize((ptr), \
28 (nbytes), __FILE__, __LINE__))
This file is a header file of source codes in the book 'C Interfaces and Implementations'.
void * Mem_calloc(long count, long nbytes, const char *file, int line)
const Except_T Mem_Failed
void * Mem_alloc(long nbytes, const char *file, int line)
void Mem_free(void *ptr, const char *file, int line)
void * Mem_resize(void *ptr, long nbytes, const char *file, int line)