A reimplementation of Mario Kart Wii's physics engine in C++
Loading...
Searching...
No Matches
Abstract::Memory::MEMiHeapHead Class Reference

#include <HeapCommon.hh>

Description

A low-level representation of a memory heap for managing dynamic memory allocation. Interface for allocating and freeing memory blocks.

Definition at line 13 of file HeapCommon.hh.

Inheritance diagram for Abstract::Memory::MEMiHeapHead:

Public Types

enum class  FillType {
  NoUse = 0 ,
  Alloc = 1 ,
  Free = 2
}
 
enum class  eOptFlag {
  ZeroFillAlloc = 0 ,
  DebugFillAlloc = 1
}
 
typedef EGG::TBitFlag< u16, eOptFlag > OptFlag
 

Public Member Functions

MEMListgetChildList ()
 
void * getHeapStart ()
 
void * getHeapEnd ()
 

Static Public Member Functions

static MEMListgetRootList ()
 
static u32 getFillVal (FillType type)
 
static MEMiHeapHeadfindContainHeap (const void *block)
 
static constexpr u16 getLinkOffset ()
 

Protected Member Functions

 MEMiHeapHead (u32 signature, void *heapStart, void *heapEnd, const OptFlag &opt)
 
void fillNoUseMemory (void *address, u32 size)
 
void fillAllocMemory (void *address, u32 size)
 
void fillFreeMemory (void *address, u32 size)
 

Private Member Functions

MEMListfindListContainHeap () const
 

Static Private Member Functions

static MEMiHeapHeadfindContainHeap (MEMList *list, const void *block)
 

Private Attributes

u32 m_signature
 
OptFlag m_optFlag
 
MEMLink m_link
 
MEMList m_childList
 
void * m_heapStart
 
void * m_heapEnd
 

Static Private Attributes

static MEMList s_rootList = MEMList(MEMiHeapHead::getLinkOffset())
 
static constexpr std::array< u32, 3 > s_fillVals
 

Member Typedef Documentation

◆ OptFlag

Member Enumeration Documentation

◆ eOptFlag

enum class Abstract::Memory::MEMiHeapHead::eOptFlag
strong

Definition at line 21 of file HeapCommon.hh.

◆ FillType

enum class Abstract::Memory::MEMiHeapHead::FillType
strong

Definition at line 15 of file HeapCommon.hh.

Constructor & Destructor Documentation

◆ MEMiHeapHead()

Abstract::Memory::MEMiHeapHead::MEMiHeapHead ( u32 signature,
void * heapStart,
void * heapEnd,
const OptFlag & opt )
protected0x8019832C

Definition at line 35 of file HeapCommon.cc.

◆ ~MEMiHeapHead()

Abstract::Memory::MEMiHeapHead::~MEMiHeapHead ( )
protected0x801984EC

Definition at line 48 of file HeapCommon.cc.

Member Function Documentation

◆ fillAllocMemory()

void Abstract::Memory::MEMiHeapHead::fillAllocMemory ( void * address,
u32 size )
protected

Definition at line 59 of file HeapCommon.cc.

◆ fillFreeMemory()

void Abstract::Memory::MEMiHeapHead::fillFreeMemory ( void * address,
u32 size )
protected

Definition at line 67 of file HeapCommon.cc.

◆ fillNoUseMemory()

void Abstract::Memory::MEMiHeapHead::fillNoUseMemory ( void * address,
u32 size )
protected

Definition at line 53 of file HeapCommon.cc.

◆ findContainHeap() [1/2]

MEMiHeapHead * Abstract::Memory::MEMiHeapHead::findContainHeap ( const void * block)
staticnodiscard0x80198658

Definition at line 30 of file HeapCommon.cc.

◆ findContainHeap() [2/2]

MEMiHeapHead * Abstract::Memory::MEMiHeapHead::findContainHeap ( MEMList * list,
const void * block )
staticnodiscardprivate0x801981EC

Definition at line 74 of file HeapCommon.cc.

◆ findListContainHeap()

MEMList & Abstract::Memory::MEMiHeapHead::findListContainHeap ( ) const
nodiscardprivate

Definition at line 94 of file HeapCommon.cc.

◆ getChildList()

MEMList & Abstract::Memory::MEMiHeapHead::getChildList ( )
nodiscard

Definition at line 7 of file HeapCommon.cc.

◆ getFillVal()

u32 Abstract::Memory::MEMiHeapHead::getFillVal ( FillType type)
staticnodiscard

Definition at line 23 of file HeapCommon.cc.

◆ getHeapEnd()

void * Abstract::Memory::MEMiHeapHead::getHeapEnd ( )
nodiscard

Definition at line 15 of file HeapCommon.cc.

◆ getHeapStart()

void * Abstract::Memory::MEMiHeapHead::getHeapStart ( )
nodiscard

Definition at line 11 of file HeapCommon.cc.

◆ getLinkOffset()

static constexpr u16 Abstract::Memory::MEMiHeapHead::getLinkOffset ( )
inlinestaticnodiscardconstexpr

Definition at line 35 of file HeapCommon.hh.

◆ getRootList()

MEMList & Abstract::Memory::MEMiHeapHead::getRootList ( )
staticnodiscard

Definition at line 19 of file HeapCommon.cc.

Member Data Documentation

◆ m_childList

MEMList Abstract::Memory::MEMiHeapHead::m_childList
private

Definition at line 54 of file HeapCommon.hh.

◆ m_heapEnd

void* Abstract::Memory::MEMiHeapHead::m_heapEnd
private

Definition at line 56 of file HeapCommon.hh.

◆ m_heapStart

void* Abstract::Memory::MEMiHeapHead::m_heapStart
private

Definition at line 55 of file HeapCommon.hh.

◆ m_link

MEMLink Abstract::Memory::MEMiHeapHead::m_link
private

Definition at line 53 of file HeapCommon.hh.

◆ m_optFlag

OptFlag Abstract::Memory::MEMiHeapHead::m_optFlag
private

Definition at line 52 of file HeapCommon.hh.

◆ m_signature

u32 Abstract::Memory::MEMiHeapHead::m_signature
private

Definition at line 51 of file HeapCommon.hh.

◆ s_fillVals

std::array<u32, 3> Abstract::Memory::MEMiHeapHead::s_fillVals
staticconstexprprivate
Initial value:
= {{
0xC3C3C3C3,
0xF3F3F3F3,
0xD3D3D3D3,
}}

Definition at line 59 of file HeapCommon.hh.

◆ s_rootList

MEMList Abstract::Memory::MEMiHeapHead::s_rootList = MEMList(MEMiHeapHead::getLinkOffset())
staticprivate

Definition at line 58 of file HeapCommon.hh.