Files
dusklight/include/JSystem/JKernel/JKRAramHeap.h
T
Pheenoh 7154ac08e1 d_a_e_fz work, doxygen revamp (#2127)
* initial freezard actor struct + setActionMode OK

* daE_FZ_Draw

* setReflectAngle

* mBoundSoundset

* daE_FZ_Execute & execute

* demoDelete

* daE_FZ_Delete & _delete

* CreateHeap

* useHeapInit

* cc_set

* mtx_set

* action WIP

* way_gake_check

* executeRollMove

* executeMove

* draw WIP

* executeDamage

* checkpoint

* create

* checkpoint

* daE_FZ_c::executeWait

* checkpoint

* daE_FZ_c::damage_check almost done

* rm asm

* rm headers

* setup_profile WIP + doxygen update

* fix merge issues

* docs fix?

* fix2

* doxygen updates

* setup g_profile_E_FZ, profile setup script WIP

* update github actions

* update progress.md
2024-04-12 00:10:30 -06:00

59 lines
1.2 KiB
C++

#ifndef JKRARAMHEAP_H
#define JKRARAMHEAP_H
#include "JSystem/JKernel/JKRAramBlock.h"
#include "JSystem/JKernel/JKRDisposer.h"
#include "dolphin/os/OSMutex.h"
/**
* @ingroup jsystem-jkernel
*
*/
class JKRAramHeap : public JKRDisposer {
public:
enum EAllocMode {
HEAD = 0,
TAIL = 1,
};
public:
// TODO: fix type
static JSUList<JKRAramBlock> sAramList;
JKRAramHeap(u32, u32);
virtual ~JKRAramHeap();
JKRAramBlock* alloc(u32, EAllocMode);
JKRAramBlock* allocFromHead(u32);
JKRAramBlock* allocFromTail(u32);
u32 getFreeSize(void);
u32 getTotalFreeSize(void);
// u32 getUsedSize(void);
void dump(void);
void free(JKRAramBlock *block) {
delete block;
}
u8 getCurrentGroupID() const { return mGroupId; }
JKRHeap* getMgrHeap() const { return mHeap; }
private:
void lock() { OSLockMutex(&mMutex); }
void unlock() { OSUnlockMutex(&mMutex); }
public:
/* 0x00 */ // vtable
/* 0x04 */ // JKRDisposer
/* 0x18 */ OSMutex mMutex;
/* 0x30 */ JKRHeap* mHeap;
/* 0x34 */ u32 mHeadAddress;
/* 0x38 */ u32 mTailAddress;
/* 0x3C */ u32 mSize;
/* 0x40 */ u8 mGroupId;
/* 0x41 */ u8 padding_0x41[3];
};
#endif /* JKRARAMHEAP_H */