Twilight Princess
Decompilation of The Legend of Zelda: Twilight Princess
Loading...
Searching...
No Matches
JKRHeap Class Referenceabstract

#include <JKRHeap.h>

+ Inheritance diagram for JKRHeap:
+ Collaboration diagram for JKRHeap:

Classes

class  TState
 

Public Member Functions

 JKRHeap (void *data, u32 size, JKRHeap *parent, bool errorFlag)
 
virtual ~JKRHeap ()
 
JKRHeapbecomeSystemHeap ()
 
JKRHeapbecomeCurrentHeap ()
 
void destroy ()
 
voidalloc (u32 size, int alignment)
 
void free (void *ptr)
 
void freeAll ()
 
void freeTail ()
 
s32 resize (void *ptr, u32 size)
 
s32 getSize (void *ptr)
 
s32 getFreeSize ()
 
voidgetMaxFreeBlock ()
 
s32 getTotalFreeSize ()
 
s32 changeGroupID (u8 newGroupId)
 
u32 getMaxAllocatableSize (int alignment)
 
JKRHeapfind (void *ptr) const
 
JKRHeapfindAllHeap (void *ptr) const
 
void dispose_subroutine (u32 start, u32 end)
 
bool dispose (void *ptr, u32 size)
 
void dispose (void *begin, void *end)
 
void dispose ()
 
bool setErrorFlag (bool errorFlag)
 
bool isSubHeap (JKRHeap *heap) const
 
virtual void callAllDisposer ()
 
virtual u32 getHeapType ()=0
 
virtual bool check ()=0
 
virtual bool dump_sort ()
 
virtual bool dump ()=0
 
virtual void do_destroy ()=0
 
virtual voiddo_alloc (u32 size, int alignment)=0
 
virtual void do_free (void *ptr)=0
 
virtual void do_freeAll ()=0
 
virtual void do_freeTail ()=0
 
virtual void do_fillFreeArea ()=0
 
virtual s32 do_resize (void *ptr, u32 size)=0
 
virtual s32 do_getSize (void *ptr)=0
 
virtual s32 do_getFreeSize ()=0
 
virtual voiddo_getMaxFreeBlock ()=0
 
virtual s32 do_getTotalFreeSize ()=0
 
virtual s32 do_changeGroupID (u8 newGroupID)
 
virtual u8 do_getCurrentGroupId ()
 
virtual void state_register (JKRHeap::TState *p, u32 id) const
 
virtual bool state_compare (JKRHeap::TState const &r1, JKRHeap::TState const &r2) const
 
virtual void state_dump (JKRHeap::TState const &p) const
 
void setDebugFill (bool debugFill)
 
bool getDebugFill () const
 
voidgetStartAddr () const
 
voidgetEndAddr () const
 
u32 getSize () const
 
bool getErrorFlag () const
 
void callErrorHandler (JKRHeap *heap, u32 size, int alignment)
 
JKRHeapgetParent () const
 
JSUTree< JKRHeap > & getHeapTree ()
 
void appendDisposer (JKRDisposer *disposer)
 
void removeDisposer (JKRDisposer *disposer)
 
void lock ()
 
void unlock ()
 
u32 getHeapSize ()
 
- Public Member Functions inherited from JKRDisposer
 JKRDisposer ()
 
virtual ~JKRDisposer ()
 

Static Public Member Functions

static bool initArena (char **memory, u32 *size, int maxHeaps)
 
static voidalloc (u32 size, int alignment, JKRHeap *heap)
 
static void free (void *ptr, JKRHeap *heap)
 
static s32 resize (void *ptr, u32 size, JKRHeap *heap)
 
static s32 getSize (void *ptr, JKRHeap *heap)
 
static JKRHeapfindFromRoot (void *ptr)
 
static void copyMemory (void *dst, void *src, u32 size)
 
static void fillMemory (void *dst, u32 size, u8 value)
 
static bool checkMemoryFilled (void *src, u32 size, u8 value)
 
static JKRErrorHandler setErrorHandler (JKRErrorHandler errorHandler)
 
static void setDefaultDebugFill (bool status)
 
static voidgetCodeStart (void)
 
static voidgetCodeEnd (void)
 
static voidgetUserRamStart (void)
 
static voidgetUserRamEnd (void)
 
static u32 getMemorySize (void)
 
static JKRHeapgetRootHeap ()
 
static JKRHeapgetRootHeap2 ()
 
static JKRHeapgetSystemHeap ()
 
static JKRHeapgetCurrentHeap ()
 
static void setSystemHeap (JKRHeap *heap)
 
static void setCurrentHeap (JKRHeap *heap)
 
static void setState_u32ID_ (TState *state, u32 id)
 
static void setState_uUsedSize_ (TState *state, u32 usedSize)
 
static void setState_u32CheckCode_ (TState *state, u32 checkCode)
 
static voidgetState_buf_ (TState *state)
 
static voidgetState_ (TState *state)
 

Static Public Attributes

static voidmCodeStart
 
static voidmCodeEnd
 
static voidmUserRamStart
 
static voidmUserRamEnd
 
static u32 mMemorySize
 
static JKRHeapsRootHeap
 
static JKRHeapsRootHeap2
 
static JKRHeapsSystemHeap
 
static JKRHeapsCurrentHeap
 
static JKRErrorHandler mErrorHandler
 

Protected Attributes

OSMutex mMutex
 
u8mStart
 
u8mEnd
 
u32 mSize
 
bool mDebugFill
 
bool mCheckMemoryFilled
 
u8 mAllocationMode
 
u8 mGroupId
 
JSUTree< JKRHeapmChildTree
 
JSUList< JKRDisposermDisposerList
 
bool mErrorFlag
 
bool mInitFlag
 
u8 padding_0x6a [2]
 

Additional Inherited Members

- Public Attributes inherited from JKRDisposer
JKRHeapmHeap
 
JSULink< JKRDisposermLink
 

Constructor & Destructor Documentation

◆ JKRHeap()

JKRHeap::JKRHeap ( void data,
u32  size,
JKRHeap parent,
bool  errorFlag 
)

◆ ~JKRHeap()

JKRHeap::~JKRHeap ( )
virtual

Member Function Documentation

◆ alloc() [1/2]

void * JKRHeap::alloc ( u32  size,
int  alignment 
)

◆ alloc() [2/2]

void * JKRHeap::alloc ( u32  size,
int  alignment,
JKRHeap heap 
)
static

◆ appendDisposer()

void JKRHeap::appendDisposer ( JKRDisposer disposer)
inline

◆ becomeCurrentHeap()

JKRHeap * JKRHeap::becomeCurrentHeap ( )

◆ becomeSystemHeap()

JKRHeap * JKRHeap::becomeSystemHeap ( )

◆ callAllDisposer()

void JKRHeap::callAllDisposer ( )
virtual

◆ callErrorHandler()

void JKRHeap::callErrorHandler ( JKRHeap heap,
u32  size,
int  alignment 
)
inline

◆ changeGroupID()

s32 JKRHeap::changeGroupID ( u8  newGroupId)

◆ check()

virtual bool JKRHeap::check ( )
pure virtual

Implemented in JKRExpHeap, JKRAssertHeap, and JKRSolidHeap.

◆ checkMemoryFilled()

static bool JKRHeap::checkMemoryFilled ( void src,
u32  size,
u8  value 
)
static

◆ copyMemory()

void JKRHeap::copyMemory ( void dst,
void src,
u32  size 
)
static

◆ destroy()

void JKRHeap::destroy ( )

◆ dispose() [1/3]

void JKRHeap::dispose ( )

◆ dispose() [2/3]

void JKRHeap::dispose ( void begin,
void end 
)

◆ dispose() [3/3]

bool JKRHeap::dispose ( void ptr,
u32  size 
)

◆ dispose_subroutine()

void JKRHeap::dispose_subroutine ( u32  start,
u32  end 
)

◆ do_alloc()

virtual void * JKRHeap::do_alloc ( u32  size,
int  alignment 
)
pure virtual

Implemented in JKRExpHeap, JKRAssertHeap, and JKRSolidHeap.

◆ do_changeGroupID()

s32 JKRHeap::do_changeGroupID ( u8  newGroupID)
virtual

Reimplemented in JKRExpHeap, and JKRAssertHeap.

◆ do_destroy()

virtual void JKRHeap::do_destroy ( )
pure virtual

Implemented in JKRExpHeap, JKRAssertHeap, and JKRSolidHeap.

◆ do_fillFreeArea()

virtual void JKRHeap::do_fillFreeArea ( )
pure virtual

Implemented in JKRExpHeap, JKRAssertHeap, and JKRSolidHeap.

◆ do_free()

virtual void JKRHeap::do_free ( void ptr)
pure virtual

Implemented in JKRAssertHeap, JKRSolidHeap, and JKRExpHeap.

◆ do_freeAll()

virtual void JKRHeap::do_freeAll ( )
pure virtual

Implemented in JKRExpHeap, JKRAssertHeap, and JKRSolidHeap.

◆ do_freeTail()

virtual void JKRHeap::do_freeTail ( )
pure virtual

Implemented in JKRExpHeap, JKRAssertHeap, and JKRSolidHeap.

◆ do_getCurrentGroupId()

u8 JKRHeap::do_getCurrentGroupId ( void  )
virtual

Reimplemented in JKRExpHeap, and JKRAssertHeap.

◆ do_getFreeSize()

virtual s32 JKRHeap::do_getFreeSize ( )
pure virtual

Implemented in JKRExpHeap, JKRAssertHeap, and JKRSolidHeap.

◆ do_getMaxFreeBlock()

virtual void * JKRHeap::do_getMaxFreeBlock ( )
pure virtual

Implemented in JKRExpHeap, JKRAssertHeap, and JKRSolidHeap.

◆ do_getSize()

virtual s32 JKRHeap::do_getSize ( void ptr)
pure virtual

Implemented in JKRAssertHeap, JKRSolidHeap, and JKRExpHeap.

◆ do_getTotalFreeSize()

virtual s32 JKRHeap::do_getTotalFreeSize ( )
pure virtual

Implemented in JKRExpHeap, JKRAssertHeap, and JKRSolidHeap.

◆ do_resize()

virtual s32 JKRHeap::do_resize ( void ptr,
u32  size 
)
pure virtual

Implemented in JKRAssertHeap, JKRSolidHeap, and JKRExpHeap.

◆ dump()

virtual bool JKRHeap::dump ( )
pure virtual

Implemented in JKRExpHeap, JKRAssertHeap, and JKRSolidHeap.

◆ dump_sort()

bool JKRHeap::dump_sort ( void  )
virtual

Reimplemented in JKRExpHeap, and JKRAssertHeap.

◆ fillMemory()

static void JKRHeap::fillMemory ( void dst,
u32  size,
u8  value 
)
static

◆ find()

JKRHeap * JKRHeap::find ( void ptr) const

◆ findAllHeap()

JKRHeap * JKRHeap::findAllHeap ( void ptr) const

◆ findFromRoot()

JKRHeap * JKRHeap::findFromRoot ( void ptr)
static

◆ free() [1/2]

void JKRHeap::free ( void ptr)

◆ free() [2/2]

void JKRHeap::free ( void ptr,
JKRHeap heap 
)
static

◆ freeAll()

void JKRHeap::freeAll ( )

◆ freeTail()

void JKRHeap::freeTail ( )

◆ getCodeEnd()

static void * JKRHeap::getCodeEnd ( void  )
inlinestatic

◆ getCodeStart()

static void * JKRHeap::getCodeStart ( void  )
inlinestatic

◆ getCurrentHeap()

static JKRHeap * JKRHeap::getCurrentHeap ( )
inlinestatic

◆ getDebugFill()

bool JKRHeap::getDebugFill ( ) const
inline

◆ getEndAddr()

void * JKRHeap::getEndAddr ( ) const
inline

◆ getErrorFlag()

bool JKRHeap::getErrorFlag ( ) const
inline

◆ getFreeSize()

s32 JKRHeap::getFreeSize ( )

◆ getHeapSize()

u32 JKRHeap::getHeapSize ( )
inline

◆ getHeapTree()

JSUTree< JKRHeap > & JKRHeap::getHeapTree ( )
inline

◆ getHeapType()

virtual u32 JKRHeap::getHeapType ( )
pure virtual

Implemented in JKRExpHeap, JKRAssertHeap, and JKRSolidHeap.

◆ getMaxAllocatableSize()

u32 JKRHeap::getMaxAllocatableSize ( int  alignment)

◆ getMaxFreeBlock()

void * JKRHeap::getMaxFreeBlock ( )

◆ getMemorySize()

static u32 JKRHeap::getMemorySize ( void  )
inlinestatic

◆ getParent()

JKRHeap * JKRHeap::getParent ( ) const
inline

◆ getRootHeap()

static JKRHeap * JKRHeap::getRootHeap ( )
inlinestatic

◆ getRootHeap2()

static JKRHeap * JKRHeap::getRootHeap2 ( )
inlinestatic

◆ getSize() [1/3]

u32 JKRHeap::getSize ( ) const
inline

◆ getSize() [2/3]

s32 JKRHeap::getSize ( void ptr)

◆ getSize() [3/3]

s32 JKRHeap::getSize ( void ptr,
JKRHeap heap 
)
static

◆ getStartAddr()

void * JKRHeap::getStartAddr ( ) const
inline

◆ getState_()

static void * JKRHeap::getState_ ( TState state)
inlinestatic

◆ getState_buf_()

static void * JKRHeap::getState_buf_ ( TState state)
inlinestatic

◆ getSystemHeap()

static JKRHeap * JKRHeap::getSystemHeap ( )
inlinestatic

◆ getTotalFreeSize()

s32 JKRHeap::getTotalFreeSize ( )

◆ getUserRamEnd()

static void * JKRHeap::getUserRamEnd ( void  )
inlinestatic

◆ getUserRamStart()

static void * JKRHeap::getUserRamStart ( void  )
inlinestatic

◆ initArena()

bool JKRHeap::initArena ( char **  memory,
u32 size,
int  maxHeaps 
)
static

◆ isSubHeap()

bool JKRHeap::isSubHeap ( JKRHeap heap) const

◆ lock()

void JKRHeap::lock ( )
inline

◆ removeDisposer()

void JKRHeap::removeDisposer ( JKRDisposer disposer)
inline

◆ resize() [1/2]

s32 JKRHeap::resize ( void ptr,
u32  size 
)

◆ resize() [2/2]

s32 JKRHeap::resize ( void ptr,
u32  size,
JKRHeap heap 
)
static

◆ setCurrentHeap()

static void JKRHeap::setCurrentHeap ( JKRHeap heap)
inlinestatic

◆ setDebugFill()

void JKRHeap::setDebugFill ( bool  debugFill)
inline

◆ setDefaultDebugFill()

static void JKRHeap::setDefaultDebugFill ( bool  status)
inlinestatic

◆ setErrorFlag()

bool JKRHeap::setErrorFlag ( bool  errorFlag)

◆ setErrorHandler()

JKRErrorHandler JKRHeap::setErrorHandler ( JKRErrorHandler  errorHandler)
static

◆ setState_u32CheckCode_()

static void JKRHeap::setState_u32CheckCode_ ( TState state,
u32  checkCode 
)
inlinestatic

◆ setState_u32ID_()

static void JKRHeap::setState_u32ID_ ( TState state,
u32  id 
)
inlinestatic

◆ setState_uUsedSize_()

static void JKRHeap::setState_uUsedSize_ ( TState state,
u32  usedSize 
)
inlinestatic

◆ setSystemHeap()

static void JKRHeap::setSystemHeap ( JKRHeap heap)
inlinestatic

◆ state_compare()

bool JKRHeap::state_compare ( JKRHeap::TState const r1,
JKRHeap::TState const r2 
) const
virtual

Reimplemented in JKRSolidHeap, and JKRExpHeap.

◆ state_dump()

void JKRHeap::state_dump ( JKRHeap::TState const p) const
virtual

◆ state_register()

void JKRHeap::state_register ( JKRHeap::TState p,
u32  id 
) const
virtual

Reimplemented in JKRSolidHeap, and JKRExpHeap.

◆ unlock()

void JKRHeap::unlock ( )
inline

Member Data Documentation

◆ mAllocationMode

u8 JKRHeap::mAllocationMode
protected

◆ mCheckMemoryFilled

bool JKRHeap::mCheckMemoryFilled
protected

◆ mChildTree

JSUTree<JKRHeap> JKRHeap::mChildTree
protected

◆ mCodeEnd

void * JKRHeap::mCodeEnd
static

◆ mCodeStart

void * JKRHeap::mCodeStart
static

◆ mDebugFill

bool JKRHeap::mDebugFill
protected

◆ mDisposerList

JSUList<JKRDisposer> JKRHeap::mDisposerList
protected

◆ mEnd

u8* JKRHeap::mEnd
protected

◆ mErrorFlag

bool JKRHeap::mErrorFlag
protected

◆ mErrorHandler

JKRErrorHandler JKRHeap::mErrorHandler
static

◆ mGroupId

u8 JKRHeap::mGroupId
protected

◆ mInitFlag

bool JKRHeap::mInitFlag
protected

◆ mMemorySize

u32 JKRHeap::mMemorySize
static

◆ mMutex

OSMutex JKRHeap::mMutex
protected

◆ mSize

u32 JKRHeap::mSize
protected

◆ mStart

u8* JKRHeap::mStart
protected

◆ mUserRamEnd

void * JKRHeap::mUserRamEnd
static

◆ mUserRamStart

void * JKRHeap::mUserRamStart
static

◆ padding_0x6a

u8 JKRHeap::padding_0x6a[2]
protected

◆ sCurrentHeap

JKRHeap * JKRHeap::sCurrentHeap
static

◆ sRootHeap

JKRHeap * JKRHeap::sRootHeap
static

◆ sRootHeap2

JKRHeap * JKRHeap::sRootHeap2
static

◆ sSystemHeap

JKRHeap * JKRHeap::sSystemHeap
static

JKRHeap.cpp JSystem Heap Framework


The documentation for this class was generated from the following files: