/* Copyright (C) 2003, 2004 Dave Bayer. Subject to the terms and conditions of the MIT License. */ /*. MEMORYDEBUG */ #define MEMORYDEBUG1 1 /*. memoryVerify */ #if MEMORYDEBUG #define memoryVerify memoryVerifyDebug #else #define memoryVerify memoryVerifyCheck #endif /*. malloc */ #if MEMORYDEBUG #define malloc(X) mallocDebug( (X), __FILE__, __LINE__, 0 ) #else #define malloc mallocCheck #endif /*. free */ #if MEMORYDEBUG #define free(X) freeDebug( (X), __FILE__, __LINE__ ) #else #define free freeCheck #endif /*. mallocCount */ #if MEMORYDEBUG #define mallocCount mallocCountDebug #else #define mallocCount mallocCountCheck #endif /* function prototypes */ #if MEMORYDEBUG void memoryVerifyDebug( void ); void *mallocDebug( size_t size, char *fileName, int lineNo, int ours ); void freeDebug( void *p, char *fileName, int lineNo ); void mallocCountDebug( void ); #else void memoryVerifyCheck( void ); void *mallocCheck( size_t size ); void freeCheck( void *p ); void mallocCountCheck( void ); #endif