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., 51 Franklin St, Fifth Floor, Boston, 15 ** MA 02110-1301, USA. 16 ** 17 ** Any permitted reproduction of these routines, in whole or in part, 18 ** must bear this legend. 19 ** 20 ** 21 ** memguard.h 22 ** 23 ** memory allocation wrapper routines 24 ** $Id: memguard.h,v 1.2 2003/03/01 02:23:01 storri Exp $ 25 */ 26 27 #ifndef _MEMGUARD_H_ 28 #define _MEMGUARD_H_ 29 30 #ifdef NOFRENDO_DEBUG 31 32 #define malloc(s) _my_malloc((s), __FILE__, __LINE__) 33 #define free(d) _my_free((void **) &(d), __FILE__, __LINE__) 34 35 extern void *_my_malloc(int size, char *file, int line); 36 extern void _my_free(void **data, char *file, int line); 37 38 #else /* Non-debugging versions of calls */ 39 40 #define malloc(s) _my_malloc((s)) 41 #define free(d) _my_free((void **) &(d)) 42 43 extern void *_my_malloc(int size); 44 extern void _my_free(void **data); 45 46 #endif /* NOFRENDO_DEBUG */ 47 48 49 extern void mem_checkblocks(void); 50 extern void mem_checkleaks(void); 51 52 extern boolean mem_debug; 53 54 #endif /* _MEMGUARD_H_ */ 55 56 /* 57 ** $Log: memguard.h,v $ 58 ** Revision 1.2 2003/03/01 02:23:01 storri 59 ** Added new line at end of file to remove compiler warning. 60 ** 61 ** Revision 1.1 2003/01/08 07:04:35 tmmm 62 ** initial import of Nosefart sources 63 ** 64 ** Revision 1.5 2000/06/26 04:54:48 matt 65 ** simplified and made more robust 66 ** 67 ** Revision 1.4 2000/06/09 15:12:25 matt 68 ** initial revision 69 ** 70 */ 71 72