10 class GHeapSegVisitor;
13 struct GAllocDebugInfo;
63 UPInt a_minAlign = 16,
64 UPInt a_granularity = 8 * 1024,
65 UPInt a_reserve = 8 * 1024,
84 static_assert(
sizeof(
HeapDesc) == 0x40);
101 static_assert(
sizeof(
HeapInfo) == 0x50);
153 static_assert(
sizeof(
RootStats) == 0x50);
171 virtual void Free(
void* a_ptr) = 0;
184 virtual void VisitMem(GHeapMemVisitor* a_visitor, std::uint32_t a_flags) = 0;
200 UPInt a_minAlign = 16,
201 UPInt a_granularity = 16 * 1024,
202 UPInt a_reserve = 16 * 1024,
241 class GHeapAllocEngine;
242 class GHeapDebugStorage;
248 [[maybe_unused]] GHeapAllocEngine* _engine;
249 [[maybe_unused]] GHeapDebugStorage* _debugStorage;
Definition GMemoryHeap.h:16
virtual void SetTracer(HeapTracer *a_tracer)=0
UPInt GetGranularity() const
std::uint32_t _padC4
Definition GMemoryHeap.h:237
GLock _heapLock
Definition GMemoryHeap.h:233
virtual void * Realloc(void *a_oldPtr, UPInt a_newSize)=0
virtual void FreeSysDirect(void *a_ptr, UPInt a_size)=0
virtual void CreateArena(UPInt a_arena, GSysAllocPaged *a_sysAlloc)=0
virtual void VisitRootSegments(GHeapSegVisitor *a_visitor)=0
bool _useLocks
Definition GMemoryHeap.h:234
GMemoryHeap * CreateHeap(const char *a_name, HeapFlags a_flags=HeapFlags::kNone, UPInt a_minAlign=16, UPInt a_granularity=16 *1024, UPInt a_reserve=16 *1024, UPInt a_threshold=UPINT_MAX, UPInt a_limit=0, GHeapID a_heapID=GHeapID::kReserved, UPInt a_arena=0)
virtual void * AllocSysDirect(UPInt a_size)=0
virtual void DestroyArena(UPInt a_arena)=0
virtual bool ArenaIsEmpty(UPInt a_arena)=0
std::uint32_t _pad24
Definition GMemoryHeap.h:228
virtual GMemoryHeap * GetAllocHeap(const void *a_this)=0
bool IsThreadSafe() const
HeapFlags
Definition GMemoryHeap.h:37
virtual void GetRootStats(RootStats *a_stats)=0
virtual void VisitMem(GHeapMemVisitor *a_visitor, std::uint32_t a_flags)=0
virtual void * AllocAutoHeap(const void *a_this, UPInt a_size, UPInt a_align)=0
UPInt _ownerThreadID
Definition GMemoryHeap.h:229
GMemoryHeap * GetParentHeap() const
friend class GHeapRootMH
Definition GMemoryHeap.h:21
virtual void ReleaseCachedMem()=0
virtual UPInt GetTotalFootprint() const =0
virtual void Free(void *a_ptr)=0
virtual UPInt GetUsableSize(const void *a_ptr)=0
void ReleaseOnFree(void *a_ptr)
virtual UPInt GetTotalUsedSpace() const =0
virtual void SetLimit(UPInt newLimit)=0
virtual void DestroyItself()=0
virtual void * Alloc(UPInt a_size)=0
virtual void SetLimitHandler(LimitHandler *handler)=0
UPInt _selfSize
Definition GMemoryHeap.h:226
MemReportType
Definition GMemoryHeap.h:25
HeapInfo _info
Definition GMemoryHeap.h:231
virtual void GetUserDebugStats(RootStats *a_stats) const =0
virtual bool GetStats(GStatBag *a_bag)=0
virtual void CheckIntegrity_Internal() const =0
virtual void UltimateCheck_Internal()=0
HeapFlags GetFlags() const
ChildListType _childHeaps
Definition GMemoryHeap.h:232
virtual UPInt GetFootprint() const =0
void * _autoRelease
Definition GMemoryHeap.h:230
friend class GHeapRoot
Definition GMemoryHeap.h:20
virtual void * Alloc(UPInt a_size, UPInt a_align)=0
std::uint16_t _padC2
Definition GMemoryHeap.h:236
bool _trackDebugInfo
Definition GMemoryHeap.h:235
virtual void * AllocAutoHeap(const void *a_this, UPInt a_size)=0
virtual GMemoryHeap * CreateHeap(const char *a_name, const HeapDesc &a_desc)=0
void AssignToCurrentThread()
virtual UPInt GetUsedSpace() const =0
void GetHeapInfo(HeapInfo *a_info) const
friend class GMemoryHeapMH
Definition GMemoryHeap.h:19
volatile std::uint32_t _refCount
Definition GMemoryHeap.h:227
virtual void VisitHeapSegments(GHeapSegVisitor *a_visitor) const =0
const char * GetName() const
virtual bool DumpMemoryLeaks_Internal()=0
Definition GMemoryHeap.h:245
Definition GSysAllocPaged.h:11
Definition AbsorbEffect.h:6
std::size_t UPInt
Definition SFTypes.h:5
GHeapID
Definition GStats.h:79
constexpr UPInt UPINT_MAX
Definition SFTypes.h:6
Definition GMemoryHeap.h:60
HeapDesc(HeapFlags a_flags=HeapFlags::kNone, UPInt a_minAlign=16, UPInt a_granularity=8 *1024, UPInt a_reserve=8 *1024, UPInt a_threshold=UPINT_MAX, UPInt a_limit=0, GHeapID a_heapID=GHeapID::kReserved, UPInt a_arena=0)
std::uint32_t pad04
Definition GMemoryHeap.h:75
UPInt granularity
Definition GMemoryHeap.h:77
UPInt limit
Definition GMemoryHeap.h:80
UPInt arena
Definition GMemoryHeap.h:82
UPInt reserve
Definition GMemoryHeap.h:78
stl::enumeration< HeapFlags, std::uint32_t > flags
Definition GMemoryHeap.h:74
GHeapID heapID
Definition GMemoryHeap.h:81
UPInt minAlign
Definition GMemoryHeap.h:76
UPInt threshold
Definition GMemoryHeap.h:79
Definition GMemoryHeap.h:94
GMemoryHeap * parent
Definition GMemoryHeap.h:98
char * name
Definition GMemoryHeap.h:99
HeapDesc desc
Definition GMemoryHeap.h:97
Definition GMemoryHeap.h:125
virtual void OnAlloc(const GMemoryHeap *a_heap, UPInt a_size, UPInt a_align, unsigned a_sID, const void *a_ptr)=0
virtual void OnCreateHeap(const GMemoryHeap *a_heap)=0
virtual void OnRealloc(const GMemoryHeap *a_heap, const void *a_oldPtr, UPInt a_newSize, const void *a_newPtr)=0
virtual void OnFree(const GMemoryHeap *a_heap, const void *a_ptr)=0
virtual void OnDestroyHeap(const GMemoryHeap *a_heap)=0
Definition GMemoryHeap.h:104
virtual void Visit(GMemoryHeap *a_parentHeap, GMemoryHeap *a_childHeap)=0
Definition GMemoryHeap.h:114
virtual bool OnExceedLimit(GMemoryHeap *a_heap, UPInt a_overLimit)=0
virtual void OnFreeSegment(GMemoryHeap *a_heap, UPInt a_freeingSize)=0
Definition GMemoryHeap.h:87
Definition GMemoryHeap.h:48
RootHeapParameter
Definition GMemoryHeap.h:50
@ kReserve
Definition GMemoryHeap.h:53
@ kMinAlign
Definition GMemoryHeap.h:51
@ kGranularity
Definition GMemoryHeap.h:52
@ kLimit
Definition GMemoryHeap.h:55
@ kThreshold
Definition GMemoryHeap.h:54
Definition GMemoryHeap.h:139
UPInt debugInfoUsedSpace
Definition GMemoryHeap.h:149
UPInt bookkeepingFootprint
Definition GMemoryHeap.h:146
UPInt pageMapUsedSpace
Definition GMemoryHeap.h:145
UPInt pageMapFootprint
Definition GMemoryHeap.h:144
UPInt sysMemFootprint
Definition GMemoryHeap.h:142
UPInt sysMemUsedSpace
Definition GMemoryHeap.h:143
UPInt debugInfoFootprint
Definition GMemoryHeap.h:148
UPInt bookkeepingUsedSpace
Definition GMemoryHeap.h:147
UPInt userDebugFootprint
Definition GMemoryHeap.h:150
UPInt userDebugUsedSpace
Definition GMemoryHeap.h:151