3#include <Foundation/Basics.h>
4#include <Foundation/Memory/Allocator.h>
5#include <Foundation/Time/Time.h>
6#include <Foundation/Types/ArrayPtr.h>
7#include <Foundation/Types/Bitflags.h>
9enum class plAllocatorTrackingMode : plUInt32
14 AllocationStatsIgnoreLeaks,
15 AllocationStatsAndStacktraces,
17 Default = PL_ALLOC_TRACKING_DEFAULT,
26 PL_DECLARE_POD_TYPE();
32 void** m_pStackTrace =
nullptr;
34 plUInt16 m_uiAlignment = 0;
35 plUInt16 m_uiStackTraceLength = 0;
43 m_pStackTrace = stackTrace.
GetPtr();
44 PL_ASSERT_DEV(stackTrace.
GetCount() < 0xFFFF,
"stack trace too long");
45 m_uiStackTraceLength = (plUInt16)stackTrace.
GetCount();
62 PL_ALWAYS_INLINE
void operator++() { Next(); }
67 PL_ALWAYS_INLINE
Iterator(
void* pData)
78 static void AddAllocation(
plAllocatorId allocatorId, plAllocatorTrackingMode mode,
const void* pPtr,
size_t uiSize,
size_t uiAlign,
plTime allocationTime);
79 static void RemoveAllocation(
plAllocatorId allocatorId,
const void* pPtr);
83 static void ResetPerFrameAllocatorStats();
98 static plUInt32 PrintMemoryLeaks(
PrintFunc printfunc);
103 static void DumpMemoryLeaks();
This class encapsulates an array and it's size. It is recommended to use this class instead of plain ...
Definition ArrayPtr.h:37
PL_ALWAYS_INLINE plUInt32 GetCount() const
Returns the number of elements in the array.
Definition ArrayPtr.h:142
PL_ALWAYS_INLINE PointerType GetPtr() const
Returns the pointer to the array.
Definition ArrayPtr.h:118
Definition MemoryTracker.h:50
Memory tracker which keeps track of all allocations and constructions.
Definition MemoryTracker.h:22
void(*)(const char *szLine) PrintFunc
Callback for printing strings.
Definition MemoryTracker.h:93
plStringView represent a read-only sub-string of a larger string, as it can store a dedicated string ...
Definition StringView.h:34
Definition Allocator.h:26
Definition MemoryTracker.h:25
The time class encapsulates a double value storing the time in seconds.
Definition Time.h:12