actually add the test code
[poe-xs-queue-array.git] / alloc.h
CommitLineData
1bbcbbe4
TC
1/* Imager's memory allocation debugging code */
2#ifndef XSQUEUE_ALLOC_H
3#define XSQUEUE_ALLOC_H
4
5#include <stddef.h>
6#include <stdlib.h>
7
d5e34ea9 8/*#define MEM_DEBUG*/
1bbcbbe4
TC
9
10#ifdef MEM_DEBUG
11
12extern void *mymalloc_file_line(size_t size, char const *file, int line);
13extern void myfree_file_line(void *block, char const *file, int line);
14extern void *myrealloc_file_line(void *block, size_t new_size, char const *file, int line);
15
16#define mymalloc(size) (mymalloc_file_line((size), __FILE__, __LINE__))
17#define myfree(block) (myfree_file_line((block), __FILE__, __LINE__))
18#define myrealloc(block, size) (myrealloc_file_line((block), (size), __FILE__, __LINE__))
19
20extern void bndcheck_all(void);
21
22#else
23
24extern void *mymalloc(size_t size);
25extern void myfree(void *block);
26extern void *myrealloc(void *block, size_t new_size);
27
28#endif
29
30#endif