Gallery Home Blog Contact

allocmem.h

/***************************************************************************
 * allocmem.h
 *
 * the header file with all the stuff in it for managing malloc'd memory
 ***************************************************************************/

#ifndef ALLOC_MEM_H		/* avoid multiple inclusion problems */
#define ALLOC_MEM_H

#ifndef DEBUG_ALLOCMEM		

void *ALLOCMEM( int size );
void *REALLOCMEM( void *pOld, int size );
void FREEMEM( void *p );

#define AllocMem( sz )		ALLOCMEM( sz )
#define ReAllocMem( pold, sz )	REALLOCMEM( (pold), (sz) )
#define FreeMem( p )		FREEMEM( p )

#else

void *ALLOCMEM( char *fname, int lineno, int size );
void *REALLOCMEM( char *fname, int lineno, void *pOld, int size );
void FREEMEM( char *fname, int lineno, void *p );

#define AllocMem( sz )		ALLOCMEM( __FILE__, __LINE__, (sz) )
#define ReAllocMem( pold, sz )	REALLOCMEM( __FILE__, __LINE__, (pold), (sz) )
#define FreeMem( p )		FREEMEM( __FILE__, __LINE__, (p) )

#endif

#endif