top | up | prev | next

DebugHeap Class

Definition at line 72 of Memory.cpp

Constructors

DebugHeap()

Member Functions

void Allocate(void* ptr, int64_t size, const char* info)
void Dispose(void* ptr)
void Done() static
bool GetDebugHeap() const
int GetDebugSerial() const
void Init() static
DebugHeap& Instance() static
int NextSerial()
void PrintLeaks()
void SetDebugHeap()
void SetDebugSerial(int debugSerial_)

Member Variables

std::unordered_map<void*, Allocation> allocationMap
bool debugHeap
int debugSerial
std::unique_ptr<DebugHeap> instance static
int serial

Constructor Details

DebugHeap Constructor

cmajor::rt::DebugHeap::DebugHeap()

Definition at line 97 of Memory.cpp :
 97 : debugHeap(false)debugSerial(0)serial(0)
 98 {
 99 }


Declaration at line 88 of Memory.cpp


Member Function Details

Allocate Member Function

void cmajor::rt::DebugHeap::Allocate(void * ptr, int64_t size, const char * info)

Definition at line 101 of Memory.cpp
Declaration at line 82 of Memory.cpp

Calls: cmajor::rt::Allocation::SetDisposed , cmajor::rt::Allocation::SetInfo , cmajor::rt::Allocation::SetSerial , cmajor::rt::Allocation::SetSize


Dispose Member Function

void cmajor::rt::DebugHeap::Dispose(void * ptr)

Definition at line 126 of Memory.cpp
Declaration at line 83 of Memory.cpp

Calls: cmajor::rt::Allocation::Disposed , cmajor::rt::Allocation::Print , cmajor::rt::Allocation::Serial , cmajor::rt::Allocation::SetDisposed


Done Member Function

void cmajor::rt::DebugHeap::Done() static

Definition at line 201 of Memory.cpp :
202 {
203     if (instance->GetDebugHeap())
204     {
205         instance->PrintLeaks();
206     }
207     instance.reset();
208 }


Declaration at line 76 of Memory.cpp

Calls: cmajor::rt::DebugHeap::GetDebugHeap , cmajor::rt::DebugHeap::PrintLeaks


GetDebugHeap Member Function

bool cmajor::rt::DebugHeap::GetDebugHeap() const

Definition at line 79 of Memory.cpp :
 79 { return debugHeap; }

Called by: cmajor::rt::DebugHeap::Done


GetDebugSerial Member Function

int cmajor::rt::DebugHeap::GetDebugSerial() const

Definition at line 81 of Memory.cpp :
 81 { return debugSerial; }


Init Member Function

void cmajor::rt::DebugHeap::Init() static

Definition at line 196 of Memory.cpp :
197 {
198     instance.reset(new DebugHeap());
199 }


Declaration at line 75 of Memory.cpp


Instance Member Function

DebugHeap & cmajor::rt::DebugHeap::Instance() static

Definition at line 77 of Memory.cpp :
 77 { return *instance; }


NextSerial Member Function

int cmajor::rt::DebugHeap::NextSerial()

Definition at line 84 of Memory.cpp :
 84 { return ++serial; }


PrintLeaks Member Function

void cmajor::rt::DebugHeap::PrintLeaks()

Definition at line 168 of Memory.cpp
Declaration at line 85 of Memory.cpp

Calls: cmajor::rt::Allocation::Disposed , cmajor::rt::Allocation::Print

Called by: cmajor::rt::DebugHeap::Done


SetDebugHeap Member Function

void cmajor::rt::DebugHeap::SetDebugHeap()

Definition at line 78 of Memory.cpp :
 78 { debugHeap = true; }


SetDebugSerial Member Function

void cmajor::rt::DebugHeap::SetDebugSerial(int debugSerial_)

Definition at line 80 of Memory.cpp :
 80 { debugSerial = debugSerial_; }


top | up | prev | next