This file is a header file of source codes in the book 'C Interfaces and Implementations'. 更多...
#include "except.h"宏定义 | |
| #define | ALLOC(nbytes) Mem_alloc((nbytes), __FILE__, __LINE__) |
| #define | CALLOC(count, nbytes) Mem_calloc((count), (nbytes), __FILE__, __LINE__) |
| #define | NEW(p) ((p) = ALLOC((long)sizeof *(p))) |
| #define | NEW0(p) ((p) = CALLOC(1, (long)sizeof *(p))) |
| #define | FREE(ptr) |
| #define | RESIZE(ptr, nbytes) |
函数 | |
| void * | Mem_alloc (long nbytes, const char *file, int line) |
| void * | Mem_calloc (long count, 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) |
变量 | |
| const Except_T | Mem_Failed |
This file is a header file of source codes in the book 'C Interfaces and Implementations'.
This header file declares functions in the source file 'src_cii/mem.c'.
在文件 mem.h 中定义.
| #define CALLOC | ( | count, | |
| nbytes | |||
| ) | Mem_calloc((count), (nbytes), __FILE__, __LINE__) |
| #define FREE | ( | ptr | ) |
| #define RESIZE | ( | ptr, | |
| nbytes | |||
| ) |
| void * Mem_calloc | ( | long | count, |
| long | nbytes, | ||
| const char * | file, | ||
| int | line | ||
| ) |
| void * Mem_resize | ( | void * | ptr, |
| long | nbytes, | ||
| const char * | file, | ||
| int | line | ||
| ) |