7#include "cAudioDefines.h"
9#if CAUDIO_USE_MEMORYTRACKER == 1
25 static cMemoryTracker* Instance()
27 static cMemoryTracker Singleton;
32 void AddAllocation(
void* pointer,
size_t size,
const char* filename,
int line,
const char* function);
35 void RemoveAllocation(
void* pointer);
40 struct cTrackedMemoryBlock
48 std::map<void*, cTrackedMemoryBlock> TrackedBlocks;
50#if CAUDIO_MEMORYTRACKER_GENERATE_STATISTICS == 1
53 Statistics() : AllocationHighWaterMark(0), CurrentAllocationBytes(0),
54 TotalAllocationBytes(0), MaxNumAllocations(0),
55 CurrentNumAllocations(0), TotalNumAllocations(0)
57 size_t AllocationHighWaterMark;
58 size_t CurrentAllocationBytes;
59 size_t TotalAllocationBytes;
61 size_t MaxNumAllocations;
62 size_t CurrentNumAllocations;
63 size_t TotalNumAllocations;
69#if CAUDIO_MEMORYTRACKER_LOG_ALL_ALLOCATIONS == 1
70 std::ofstream outMemLog;
Main namespace for the entire cAudio library.