183void*
operator new(
size_t size);
184void*
operator new(
size_t size,
int alignment);
187void*
operator new[](
size_t size);
188void*
operator new[](
size_t size,
int alignment);
191void operator delete(
void* ptr);
192void operator delete[](
void* ptr);
194inline void*
operator new(
size_t size,
void* ptr) {
215 systemHeap->
free(ptr);
void JKRFreeToHeap(JKRHeap *heap, void *ptr)
Definition JKRHeap.h:209
s32 JKRResizeMemBlock(JKRHeap *heap, void *ptr, u32 size)
Definition JKRHeap.h:242
JKRHeap * JKRGetCurrentHeap()
Definition JKRHeap.h:226
JKRHeap * JKRGetSystemHeap()
Definition JKRHeap.h:222
void(* JKRErrorHandler)(void *, u32, int)
Definition JKRHeap.h:8
u32 JKRGetMemBlockSize(JKRHeap *heap, void *block)
Definition JKRHeap.h:234
JKRHeap * JKRGetRootHeap()
Definition JKRHeap.h:246
void * JKRAllocFromSysHeap(u32 size, int alignment)
Definition JKRHeap.h:204
JKRHeap * JKRSetCurrentHeap(JKRHeap *heap)
Definition JKRHeap.h:230
void * JKRAlloc(u32 size, int alignment)
Definition JKRHeap.h:238
void JKRFreeToSysHeap(void *ptr)
Definition JKRHeap.h:213
void * JKRAllocFromHeap(JKRHeap *heap, u32 size, int alignment)
Definition JKRHeap.h:200
void JKRFree(void *ptr)
Definition JKRHeap.h:218
void JKRDefaultMemoryErrorRoutine(void *heap, u32 size, int alignment)
Definition JKRHeap.cpp:390
void OSUnlockMutex(OSMutex *mutex)
Definition OSMutex.c:88
void OSLockMutex(OSMutex *mutex)
Definition OSMutex.c:62
T cLib_calcTimer(T *value)
Definition c_lib.h:74
static s32 r2
Definition c_math.cpp:176
static s32 r1
Definition c_math.cpp:173
Definition JKRDisposer.h:12
JKRHeap * getHeap() const
Definition JKRHeap.h:30
u32 getId() const
Definition JKRHeap.h:31
u32 getUsedSize() const
Definition JKRHeap.h:28
JKRHeap * mHeap
Definition JKRHeap.h:24
u32 mUsedSize
Definition JKRHeap.h:20
u32 getCheckCode() const
Definition JKRHeap.h:29
u32 mId
Definition JKRHeap.h:25
u32 mBuf
Definition JKRHeap.h:22
u32 field_0xc
Definition JKRHeap.h:23
u32 mCheckCode
Definition JKRHeap.h:21
virtual void state_dump(JKRHeap::TState const &p) const
Definition JKRHeap.cpp:496
void lock()
Definition JKRHeap.h:107
OSMutex mMutex
Definition JKRHeap.h:114
virtual bool dump_sort()
Definition m_Do_main.cpp:556
static JKRHeap * getCurrentHeap()
Definition JKRHeap.h:154
virtual void state_register(JKRHeap::TState *p, u32 id) const
Definition JKRHeap.cpp:483
static void * getUserRamEnd(void)
Definition JKRHeap.h:146
void destroy()
Definition JKRHeap.cpp:138
bool mErrorFlag
Definition JKRHeap.h:124
static void * mCodeEnd
Definition JKRHeap.h:167
JKRHeap * findAllHeap(void *ptr) const
Definition JKRHeap.cpp:307
virtual void * do_getMaxFreeBlock()=0
void * getEndAddr() const
Definition JKRHeap.h:90
virtual s32 do_getTotalFreeSize()=0
static JKRHeap * sCurrentHeap
Definition JKRHeap.h:178
void * getStartAddr() const
Definition JKRHeap.h:89
void dispose()
Definition JKRHeap.cpp:368
virtual s32 do_resize(void *ptr, u32 size)=0
bool isSubHeap(JKRHeap *heap) const
Definition JKRHeap.cpp:419
static void * getCodeStart(void)
Definition JKRHeap.h:143
static void * getState_buf_(TState *state)
Definition JKRHeap.h:163
static void setState_uUsedSize_(TState *state, u32 usedSize)
Definition JKRHeap.h:159
static JKRHeap * getSystemHeap()
Definition JKRHeap.h:153
void * alloc(u32 size, int alignment)
Definition JKRHeap.cpp:156
static JKRErrorHandler mErrorHandler
Definition JKRHeap.h:180
u8 mAllocationMode
Definition JKRHeap.h:120
static void setState_u32CheckCode_(TState *state, u32 checkCode)
Definition JKRHeap.h:160
JKRHeap * becomeCurrentHeap()
Definition JKRHeap.cpp:131
virtual void callAllDisposer()
Definition JKRHeap.cpp:183
u8 mGroupId
Definition JKRHeap.h:121
bool mDebugFill
Definition JKRHeap.h:118
virtual s32 do_getFreeSize()=0
static void setDefaultDebugFill(bool status)
Definition JKRHeap.h:142
virtual s32 do_changeGroupID(u8 newGroupID)
Definition JKRHeap.cpp:503
bool getDebugFill() const
Definition JKRHeap.h:88
s32 resize(void *ptr, u32 size)
Definition JKRHeap.cpp:219
static void * getState_(TState *state)
Definition JKRHeap.h:164
virtual void * do_alloc(u32 size, int alignment)=0
void * getMaxFreeBlock()
Definition JKRHeap.cpp:248
static void * getUserRamStart(void)
Definition JKRHeap.h:145
u8 padding_0x6a[2]
Definition JKRHeap.h:126
static void setSystemHeap(JKRHeap *heap)
Definition JKRHeap.h:155
s32 getTotalFreeSize()
Definition JKRHeap.cpp:253
void unlock()
Definition JKRHeap.h:108
JKRHeap * find(void *ptr) const
Definition JKRHeap.cpp:287
static JKRHeap * getRootHeap2()
Definition JKRHeap.h:150
virtual void do_fillFreeArea()=0
virtual u32 getHeapType()=0
void removeDisposer(JKRDisposer *disposer)
Definition JKRHeap.h:106
bool mInitFlag
Definition JKRHeap.h:125
virtual u8 do_getCurrentGroupId()
Definition JKRHeap.cpp:508
void freeTail()
Definition JKRHeap.cpp:200
virtual void do_freeAll()=0
static u32 mMemorySize
Definition JKRHeap.h:170
virtual void do_free(void *ptr)=0
u32 getHeapSize()
Definition JKRHeap.h:109
static u32 getMemorySize(void)
Definition JKRHeap.h:147
static void * mUserRamStart
Definition JKRHeap.h:168
JSUList< JKRDisposer > mDisposerList
Definition JKRHeap.h:123
virtual ~JKRHeap()
Definition JKRHeap.cpp:63
static void * getCodeEnd(void)
Definition JKRHeap.h:144
void callErrorHandler(JKRHeap *heap, u32 size, int alignment)
Definition JKRHeap.h:93
static bool initArena(char **memory, u32 *size, int maxHeaps)
Definition JKRHeap.cpp:93
static bool checkMemoryFilled(void *src, u32 size, u8 value)
void appendDisposer(JKRDisposer *disposer)
Definition JKRHeap.h:105
void freeAll()
Definition JKRHeap.cpp:192
void dispose_subroutine(u32 start, u32 end)
Definition JKRHeap.cpp:329
static JKRHeap * getRootHeap()
Definition JKRHeap.h:148
u32 getSize() const
Definition JKRHeap.h:91
static JKRErrorHandler setErrorHandler(JKRErrorHandler errorHandler)
Definition JKRHeap.cpp:407
virtual bool state_compare(JKRHeap::TState const &r1, JKRHeap::TState const &r2) const
Definition JKRHeap.cpp:490
u8 * mStart
Definition JKRHeap.h:115
bool mCheckMemoryFilled
Definition JKRHeap.h:119
static JKRHeap * findFromRoot(void *ptr)
Definition JKRHeap.cpp:274
JKRHeap * getParent() const
Definition JKRHeap.h:99
static void setState_u32ID_(TState *state, u32 id)
Definition JKRHeap.h:158
static void copyMemory(void *dst, void *src, u32 size)
Definition JKRHeap.cpp:376
s32 getFreeSize()
Definition JKRHeap.cpp:243
u32 mSize
Definition JKRHeap.h:117
JSUTree< JKRHeap > mChildTree
Definition JKRHeap.h:122
bool getErrorFlag() const
Definition JKRHeap.h:92
void setDebugFill(bool debugFill)
Definition JKRHeap.h:87
JKRHeap * becomeSystemHeap()
Definition JKRHeap.cpp:124
JSUTree< JKRHeap > & getHeapTree()
Definition JKRHeap.h:104
void free(void *ptr)
Definition JKRHeap.cpp:175
static JKRHeap * sRootHeap2
Definition JKRHeap.h:174
s32 changeGroupID(u8 newGroupId)
Definition JKRHeap.cpp:258
static void fillMemory(void *dst, u32 size, u8 value)
virtual void do_destroy()=0
u8 * mEnd
Definition JKRHeap.h:116
static JKRHeap * sRootHeap
Definition JKRHeap.h:172
static void * mUserRamEnd
Definition JKRHeap.h:169
bool setErrorFlag(bool errorFlag)
Definition JKRHeap.cpp:399
static void * mCodeStart
Definition JKRHeap.h:166
static void setCurrentHeap(JKRHeap *heap)
Definition JKRHeap.h:156
u32 getMaxAllocatableSize(int alignment)
Definition JKRHeap.cpp:267
virtual void do_freeTail()=0
virtual s32 do_getSize(void *ptr)=0
static JKRHeap * sSystemHeap
Definition JKRHeap.h:177
bool remove(JSULink< T > *link)
Definition JSUList.h:111
bool append(JSULink< T > *link)
Definition JSUList.h:103
T * getObject() const
Definition JSUList.h:209
JSUTree< T > * getParent() const
Definition JSUList.h:211
static void end(b_oh_class *i_this)
Definition d_a_b_oh.cpp:527
static SECTION_RODATA u8 const id[8]
Definition d_a_npc_bans.cpp:1309
static u16 data[4]
Definition d_vibration.cpp:114
static u8 block[48]
Definition fstload.c:39
static s32 status
Definition fstload.c:6
@ start
Definition strtoul.c:8
unsigned long u32
Definition types.h:10
signed long s32
Definition types.h:6
unsigned char u8
Definition types.h:8