XII Release 0.1.0
Loading...
Searching...
No Matches
xiiMemoryTracker Class Reference

#include <MemoryTracker.h>

Classes

struct  AllocationInfo
class  Iterator

Public Types

using PrintFunc = void (*)(const char* szLine)
 Callback for printing strings.

Static Public Member Functions

static xiiAllocatorId RegisterAllocator (xiiStringView sName, xiiAllocatorTrackingMode mode, xiiAllocatorId parentId)
static void DeregisterAllocator (xiiAllocatorId allocatorId)
static void AddAllocation (xiiAllocatorId allocatorId, xiiAllocatorTrackingMode mode, const void *pPtr, size_t uiSize, size_t uiAlign, xiiTime allocationTime)
static void RemoveAllocation (xiiAllocatorId allocatorId, const void *pPtr)
static void RemoveAllAllocations (xiiAllocatorId allocatorId)
static void SetAllocatorStats (xiiAllocatorId allocatorId, const xiiAllocator::Stats &stats)
static void ResetPerFrameAllocatorStats ()
static xiiStringView GetAllocatorName (xiiAllocatorId allocatorId)
static const xiiAllocator::Stats & GetAllocatorStats (xiiAllocatorId allocatorId)
static xiiAllocatorId GetAllocatorParentId (xiiAllocatorId allocatorId)
static const AllocationInfo & GetAllocationInfo (xiiAllocatorId allocatorId, const void *pPtr)
static Iterator GetIterator ()
static xiiUInt32 PrintMemoryLeaks (PrintFunc printfunc)
static void DumpMemoryLeaks ()

Detailed Description

Global memory tracking system for debugging, profiling, and leak detection.

This singleton provides comprehensive memory allocation tracking across all allocators in the system. It supports different tracking modes ranging from basic statistics to full stack trace recording for every allocation.

Member Function Documentation

◆ DumpMemoryLeaks()

void xiiMemoryTracker::DumpMemoryLeaks ( )
static

Prints the known memory leaks to xiiLog and triggers an assert if there are any.

This is useful to call at the end of an application, to get a debug breakpoint in case of memory leaks.

◆ PrintMemoryLeaks()

xiiUInt32 xiiMemoryTracker::PrintMemoryLeaks ( PrintFunc printfunc)
static

Reports back information about all currently known root memory leaks.

Returns the number of found memory leaks.


The documentation for this class was generated from the following files:
  • /home/runner/work/XII/XII/Source/Engine/Foundation/Memory/MemoryTracker.h
  • /home/runner/work/XII/XII/Source/Engine/Foundation/Memory/Implementation/MemoryTracker.cpp