mmm.h

来自「SVMcfg: Learns a weighted context free g」· C头文件 代码 · 共 32 行

H
32
字号
/* mmm.h
 *
 * Mark's memory manager
 *
 * Defines CALLOC, MALLOC, REALLOC and FREE, which are just like the
 * standard versions, except that these do varying amounts
 * of sanity checking, depending on the value of NDEBUG.
 *
 * If NDEBUG is defined, they merely check that the memory is actually
 * allocated, and throw an error if it is not.
 *
 * If NDEBUG is not defined, then in addition they:
 *
 *  * check blocks for sanity
 *  * provide a sentinel at either end, and check that it has not been overwritten
 *  * track the number of allocated blocks and allocated bytes
 */

#include <stdlib.h>

extern	long	mmm_blocks_allocated;

#define CALLOC(n,m)	mmm_calloc(n,m)
#define MALLOC(n)	mmm_malloc(n)
#define REALLOC(x,n)	mmm_realloc(x,n)
#define FREE(x)		mmm_free(x)

void *mmm_calloc(size_t count, size_t size);
void *mmm_malloc(size_t n);
void *mmm_realloc(void *ptr, size_t size);
void mmm_free(void *ptr);

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?