TC::New Class Reference
[Debug Support Classes]

A class which provides the functionality to check allocations and deallocations. More...

#include <TCNew.h>

Inheritance diagram for TC::New:

Inheritance graph
[legend]
Collaboration diagram for TC::New:

Collaboration graph
[legend]

List of all members.

Public Member Functions

bool CheckMemory () const
void EnableMemoryChecking ()
 turn on memory checking
void * Allocate (uint32 size, const char *fileName, sint32 line)
 Method makes memory allocation.
void Free (void *pointer)
 Method frees memory.
void PrintCurrentMemoryAllocation ()
 Writes to stdout the memory allocation.
void PrintMemoryLeaks ()
 Writes to stdout the memory leaks.
 ~New ()
 Destructor.

Static Public Member Functions

static NewGetInstance ()
 Get the only TCNew object.

Private Member Functions

 New ()
 Constructor.

Private Attributes

uint64 m_num_allocate_calls
 Total number of allocation calls.
uint64 m_num_allocated_pointers
 number of current allocated pointers
uint64 m_max_num_allocated_pointers
 number of max allocated pointers
uint64 m_max_num_allocated_bytes
 number of current allocated bytes
uint64 m_num_allocated_bytes
 number of max allocated bytes
bool m_check_memory
 defines if we are currently checking allocations or not
NewPointer * m_first_pointer
 Pointer to the first allocated memory.
NewPointer * m_last_pointer
 Pointer to the last allocated memory.

Static Private Attributes

static Newm_instance
 The one and only TCNew object.


Detailed Description

A class which provides the functionality to check allocations and deallocations.

Definition at line 60 of file TCNew.h.


Constructor & Destructor Documentation

TC::New::~New (  ) 

Destructor.

TC::New::New (  )  [private]

Constructor.


Member Function Documentation

static New* TC::New::GetInstance (  )  [inline, static]

Get the only TCNew object.

Definition at line 66 of file TCNew.h.

Referenced by operator delete(), operator delete[](), operator new(), and operator new[]().

Here is the caller graph for this function:

bool TC::New::CheckMemory (  )  const [inline]

Returns:
if memory checking is turned on or not

Definition at line 71 of file TCNew.h.

void TC::New::EnableMemoryChecking (  ) 

turn on memory checking

void* TC::New::Allocate ( uint32  size,
const char *  fileName,
sint32  line 
)

Method makes memory allocation.

void TC::New::Free ( void *  pointer  ) 

Method frees memory.

void TC::New::PrintCurrentMemoryAllocation (  ) 

Writes to stdout the memory allocation.

void TC::New::PrintMemoryLeaks (  ) 

Writes to stdout the memory leaks.


Member Data Documentation

Total number of allocation calls.

Definition at line 94 of file TCNew.h.

number of current allocated pointers

Definition at line 96 of file TCNew.h.

number of max allocated pointers

Definition at line 98 of file TCNew.h.

number of current allocated bytes

Definition at line 100 of file TCNew.h.

number of max allocated bytes

Definition at line 102 of file TCNew.h.

bool TC::New::m_check_memory [private]

defines if we are currently checking allocations or not

Definition at line 104 of file TCNew.h.

NewPointer* TC::New::m_first_pointer [private]

Pointer to the first allocated memory.

Definition at line 107 of file TCNew.h.

NewPointer* TC::New::m_last_pointer [private]

Pointer to the last allocated memory.

Definition at line 109 of file TCNew.h.

New* TC::New::m_instance [static, private]

The one and only TCNew object.

Definition at line 112 of file TCNew.h.


The documentation for this class was generated from the following file:

Copyright (c) Thomas Goessler 2003 - 2008