1 /*
2 ** Nofrendo (c) 1998-2000 Matthew Conte (matt@conte.com)
3 **
4 **
5 ** This program is free software; you can redistribute it and/or
6 ** modify it under the terms of version 2 of the GNU Library General
7 ** Public License as published by the Free Software Foundation.
8 **
9 ** This program is distributed in the hope that it will be useful,
10 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12 ** Library General Public License for more details.  To obtain a
13 ** copy of the GNU Library General Public License, write to the Free
14 ** Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
15 **
16 ** Any permitted reproduction of these routines, in whole or in part,
17 ** must bear this legend.
18 **
19 **
20 ** memguard.h
21 **
22 ** memory allocation wrapper routines
23 ** $Id: memguard.h,v 1.1 2003/04/08 20:46:46 ben Exp $
24 */
25 
26 #ifndef  _MEMGUARD_H_
27 #define  _MEMGUARD_H_
28 
29 #ifdef NOFRENDO_DEBUG
30 
31 #define  malloc(s)   _my_malloc((s), __FILE__, __LINE__)
32 #define  free(d)     _my_free((void **) &(d), __FILE__, __LINE__)
33 
34 extern void *_my_malloc(int size, char *file, int line);
35 extern void _my_free(void **data, char *file, int line);
36 
37 #else /* Non-debugging versions of calls */
38 
39 #define  malloc(s)   _my_malloc((s))
40 #define  free(d)     _my_free((void **) &(d))
41 
42 extern void *_my_malloc(int size);
43 extern void _my_free(void **data);
44 
45 #endif /* NOFRENDO_DEBUG */
46 
47 
48 extern void mem_checkblocks(void);
49 extern void mem_checkleaks(void);
50 
51 extern boolean mem_debug;
52 
53 #endif   /* _MEMGUARD_H_ */
54 
55 /*
56 ** $Log: memguard.h,v $
57 ** Revision 1.1  2003/04/08 20:46:46  ben
58 ** add new input for NES music file.
59 **
60 ** Revision 1.5  2000/06/26 04:54:48  matt
61 ** simplified and made more robust
62 **
63 ** Revision 1.4  2000/06/09 15:12:25  matt
64 ** initial revision
65 **
66 */
67