2006-09-25 09:46:28 -07:00
|
|
|
/*! \file memint.h
|
|
|
|
* \brief Internal framework definitions for the memory system.
|
2007-06-28 10:47:08 -07:00
|
|
|
*/
|
|
|
|
#ifndef _memint_h
|
|
|
|
#define _memint_h
|
|
|
|
|
|
|
|
/* The size of saftey buffer to leave before and after any malloc'ed memory.
|
|
|
|
Can use this to check writing over end of buffers */
|
|
|
|
|
|
|
|
#define SAFETY_ZONE_SIZE (32)
|
|
|
|
|
|
|
|
|
|
|
|
/* The character used to initialise malloc'ed memory, or to trash memory before
|
|
|
|
freeing it */
|
|
|
|
#define SAFETY_ZONE_BYTE (0xac)
|
|
|
|
#define INITIALISE_BYTE (0xcd)
|
|
|
|
#define FREE_BYTE (0xdd)
|
|
|
|
|
|
|
|
// memory block header for the treap code
|
|
|
|
typedef struct _mem_node
|
|
|
|
{
|
|
|
|
TREAP_NODE_BASE; // The treap data to store the node
|
|
|
|
TREAP_NODE_DEBUG; // The debug info for the node (file, line).
|
|
|
|
UDWORD size; // The memory block size
|
|
|
|
} MEM_NODE;
|
|
|
|
|
|
|
|
/* compare two memory blocks */
|
2006-11-24 17:26:05 -08:00
|
|
|
extern SDWORD memBlockCmp(void *key1, void *key2);
|
2007-06-28 10:47:08 -07:00
|
|
|
|
|
|
|
/* Recursive function to print out the list of memory blocks */
|
|
|
|
extern SDWORD memRecReport(MEM_NODE *psRoot);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|