Memory heap chacking class.
![]() | Validation Validation result |
![]() | Allocate ( size_t nSize, const char * file, int line, const char * className ) Allocate a memory block. |
![]() | Allocate ( size_t count, size_t iSize, const char * file, int line ) Allocate a memory block. |
![]() | Reallocate ( void * ptr, size_t nSize, const char * file, int line ) Change the size of an allocated memory block. |
![]() | Deallocate ( void * ptr, const char * className ) Free a memory block. |
![]() | Validate ( void * ptr, const char * className, ostream * error ) Validate the memory pointer. |
![]() | ValidateHeap ( ostream * error = NULL ) Validate all objects in memory. |
![]() | SetIgnoreAllocations ( BOOL ignore ) Ignore/Monitor allocations. |
![]() | DumpStatistics () Get memory check system statistics. |
![]() | DumpStatistics (ostream & strm) Get memory check system statistics. |
![]() | DumpObjectsSince ( DWORD objectNumber ) Dump allocated objects. |
![]() | DumpObjectsSince ( DWORD objectNumber, ostream & strm ) Dump allocated objects. |
![]() | SetAllocationBreakpoint ( DWORD point ) Set break point allocation number. |
![]() | PMemoryHeap () Initialise the memory checking subsystem. |
Memory heap chacking class. This class implements the memory heap checking and validation functions. It maintains lists of allocated block so that memory leaks can be detected. It also initialises memory on allocation and deallocation to help catch errors involving the use of dangling pointers.
Output is to the default stream.
static void* Allocate( size_t nSize, const char * file, int line, const char * className )
file - Source file name for allocating function.
line - Source file line for allocating function.
className - Class name for allocating function.static void* Allocate( size_t count, size_t iSize, const char * file, int line )
iSize - Size in bytes of each item.
file - Source file name for allocating function.
line - Source file line for allocating function.static void* Reallocate( void * ptr, size_t nSize, const char * file, int line )
nSize - New number of bytes to allocate.
file - Source file name for allocating function.
line - Source file line for allocating function.static void Deallocate( void * ptr, const char * className )
className - Class name for deallocating function.enum Validation
static Validation Validate( void * ptr, const char * className, ostream * error )
className - Class name it should be.
error - Stream to receive error message (may be NULL)static BOOL ValidateHeap( ostream * error = NULL )
static BOOL SetIgnoreAllocations( BOOL ignore )
static void DumpStatistics()
static void DumpStatistics(ostream & strm)
static void DumpObjectsSince( DWORD objectNumber )
static void DumpObjectsSince( DWORD objectNumber, ostream & strm )
strm - Stream to output dumpstatic void SetAllocationBreakpoint( DWORD point )
Alphabetic index HTML hierarchy of classes or Java