#include <ExpHeap.hh>
High-level implementation of a memory heap for managing dynamic memory allocation. Allocation may occur anywhere within the memory space the heap is created from.
Due to requesting chunks from a provided memory block, internal fragmentation is non-existent, but external fragmentation is still possible. Allocating temporary blocks from the tail, and scene-permanent blocks from the head, is recommended. The memory overhead per allocation is sizeof(Abstract::Memory::MEMiExpBlockHead).
Definition at line 15 of file ExpHeap.hh.
Classes | |
| class | GroupSizeRecord |
| Memory blocks have group IDs assigned to them (default 0). This class is a record of the total sum of those blocks' sizes, categorized by group ID. Used for memory profiling. More... | |
Public Member Functions | |
| void | destroy () override |
| Kind | getHeapKind () const override |
| void * | alloc (size_t size, s32 align) override |
| void | free (void *block) override |
| u32 | getAllocatableSize (s32 align=4) const override |
| void | calcGroupSize (GroupSizeRecord *record) |
| void | setGroupID (u16 groupID) |
| u16 | getGroupID () const |
| Abstract::Memory::MEMiExpHeapHead * | dynamicCastHandleToExp () |
| const Abstract::Memory::MEMiExpHeapHead * | dynamicCastHandleToExp () const |
Public Member Functions inherited from EGG::Heap | |
| Heap (Abstract::Memory::MEMiHeapHead *handle) | |
| void | dispose () |
| void | disableAllocation () |
| void | enableAllocation () |
| bool | tstDisableAllocation () const |
| void | appendDisposer (Disposer *disposer) |
| void | removeDisposer (Disposer *disposer) |
| Heap * | becomeAllocatableHeap () |
| Heap * | becomeCurrentHeap () |
| void | registerHeapBuffer (void *buffer) |
| void * | getStartAddress () |
| void * | getEndAddress () |
| const char * | getName () const |
| Heap * | getParentHeap () const |
| void | setName (const char *name) |
| void | setParentHeap (Heap *heap) |
Static Public Member Functions | |
| static void | addGroupSize (void *block, Abstract::Memory::MEMiHeapHead *heap, uintptr_t param) |
| static ExpHeap * | create (void *startAddress, size_t size, u16 opt) |
| static ExpHeap * | create (size_t size, Heap *heap, u16 opt) |
Static Public Member Functions inherited from EGG::Heap | |
| static void | initialize () |
| static void * | alloc (size_t size, int align, Heap *pHeap) |
| static void | free (void *block, Heap *pHeap) |
| static Heap * | findHeap (Abstract::Memory::MEMiHeapHead *handle) |
| static Heap * | findContainHeap (const void *block) |
| static ExpHeap * | dynamicCastToExp (Heap *heap) |
| static Heap * | getCurrentHeap () |
| static constexpr uintptr_t | getOffset () |
Private Member Functions | |
| ExpHeap (Abstract::Memory::MEMiHeapHead *handle) | |
Additional Inherited Members | |
Public Types inherited from EGG::Heap | |
| enum class | Kind { None , Expanded , Frame , Unit , Assert } |
Protected Types inherited from EGG::Heap | |
| enum class | eFlags { Lock = 0 } |
| typedef TBitFlag< u16, eFlags > | Flags |
Protected Attributes inherited from EGG::Heap | |
| Abstract::Memory::MEMiHeapHead * | m_handle |
| void * | m_block |
| Heap * | m_parentHeap |
| Flags | m_flags |
| Abstract::Memory::MEMLink | m_link |
| Abstract::Memory::MEMList | m_children |
| const char * | m_name |
Static Protected Attributes inherited from EGG::Heap | |
| static Abstract::Memory::MEMList | s_heapList = MEMList(EGG::Heap::getOffset()) |
| static Heap * | s_currentHeap = nullptr |
| static Heap * | s_allocatableHeap = nullptr |
|
override0x802269A8 |
Definition at line 12 of file ExpHeap.cc.
|
private |
Definition at line 9 of file ExpHeap.cc.
|
static0x80226CA0 |
Definition at line 95 of file ExpHeap.cc.
|
nodiscardoverridevirtual0x80226C04 |
Implements EGG::Heap.
Definition at line 76 of file ExpHeap.cc.
|
0x80226CFC |
Definition at line 105 of file ExpHeap.cc.
Definition at line 42 of file ExpHeap.cc.
|
staticnodiscard0x80226A1C |
Definition at line 18 of file ExpHeap.cc.
|
overridevirtual0x80226B94 |
Implements EGG::Heap.
Definition at line 67 of file ExpHeap.cc.
|
nodiscard |
Definition at line 119 of file ExpHeap.cc.
|
nodiscard |
Definition at line 123 of file ExpHeap.cc.
|
overridevirtual0x80226C78 |
Implements EGG::Heap.
Definition at line 85 of file ExpHeap.cc.
|
nodiscardoverridevirtual0x80226C90 |
Implements EGG::Heap.
Definition at line 90 of file ExpHeap.cc.
|
nodiscard |
Definition at line 115 of file ExpHeap.cc.
|
inlinenodiscardoverridevirtual0x80226EFC |
Implements EGG::Heap.
Definition at line 40 of file ExpHeap.hh.
|
0x80226C98 |
Definition at line 111 of file ExpHeap.cc.