2 * mem.c: memory allocation wrappers with a few simple checks
4 * Copyright (c) 2002-2009 Dennis Stosberg <dennis@stosberg.net>
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License,
8 * version 2 as published by the Free Software Foundation
23 * A container to keep the information about allocated memory.
32 #define yfree(p) yfree_dbg(p, __FILE__, __LINE__)
33 void yfree_dbg(void *p
, const char *file
, int line
);
35 #define ymalloc(size) ymalloc_dbg(size, __FILE__, __LINE__)
36 void *ymalloc_dbg(size_t size
, const char *file
, int line
);
38 #define ycalloc(num, size) ymalloc_dbg(num, size, __FILE__, __LINE__)
39 void *ycalloc_dbg(size_t number
, size_t size
, const char *file
, int line
);
41 #define yrealloc(p, size) yrealloc_dbg(p, size, __FILE__, __LINE__)
42 void *yrealloc_dbg(void *p
, size_t size
, const char *file
, int line
);
45 #define yfree(p) free(p)
46 #define ymalloc(size) malloc(size)
47 #define ycalloc(num, size) calloc(num, size);
48 #define yrealloc(p, size) realloc(p, size);