diff options
| author | Jcw87 <Jcw87@users.noreply.github.com> | 2023-10-19 05:32:02 -0700 |
|---|---|---|
| committer | Jcw87 <Jcw87@users.noreply.github.com> | 2023-10-19 23:47:33 -0700 |
| commit | 804c8ea82dfe03df73bf6c1928986187fb7515f0 (patch) | |
| tree | 763cc01c2e28d95a0ad13d469f4556ca38b4d2fe /include | |
| parent | bf77eba324af85596d83eb17f6871cd6138e96e8 (diff) | |
JASHeapCtrl
Diffstat (limited to 'include')
| -rw-r--r-- | include/JSystem/JAudio/JASHeapCtrl.h | 59 | ||||
| -rw-r--r-- | include/JSystem/JSupport/JSUList.h | 2 |
2 files changed, 60 insertions, 1 deletions
diff --git a/include/JSystem/JAudio/JASHeapCtrl.h b/include/JSystem/JAudio/JASHeapCtrl.h new file mode 100644 index 00000000..27f9fc80 --- /dev/null +++ b/include/JSystem/JAudio/JASHeapCtrl.h @@ -0,0 +1,59 @@ +#ifndef JASHEAPCTRL_H +#define JASHEAPCTRL_H + +#include "JSystem/JSupport/JSUList.h" +#include "dolphin/os/OSMutex.h" + +namespace JASystem { + namespace Kernel { + class TDisposer { + public: + virtual void onDispose() {} + }; + + class THeap { + public: + enum Type { + Type0, + Type1, + }; + + THeap(TDisposer*); + void initRootHeap(void*, u32, Type); + bool alloc(THeap*, u32); + bool free(); + void insertChild(THeap* param_1, THeap* param_2, void* param_3, u32 param_4, bool param_5); + JASystem::Kernel::THeap* getTailHeap(); + u32 getTailOffset(); + u32 getCurOffset(); + + bool isAllocated() { return mBase; } + + /* 0x00 */ JSUTree<THeap> mTree; + /* 0x1C */ OSMutex mMutex; + /* 0x34 */ TDisposer* mDisposer; + /* 0x38 */ Type mType; + /* 0x3C */ u8* mBase; + /* 0x40 */ u32 mSize; + /* 0x44 */ THeap* field_0x44; + }; + + class TSolidHeap { + public: + TSolidHeap(); + ~TSolidHeap() {} + int alloc(long param_1); + void freeAll(); + void init(u8* param_1, long param_2); + int getRemain(); + + /* 0x00 */ u32 field_0x0; + /* 0x04 */ int field_0x4; + /* 0x08 */ int field_0x8; + /* 0x0C */ int field_0xc; + /* 0x10 */ int field_0x10; + }; + } +} + +#endif /* JASHEAPCTRL_H */ diff --git a/include/JSystem/JSupport/JSUList.h b/include/JSystem/JSupport/JSUList.h index 6adb0bc7..e117824b 100644 --- a/include/JSystem/JSupport/JSUList.h +++ b/include/JSystem/JSupport/JSUList.h @@ -212,7 +212,7 @@ public: return *this; } - T& operator*() { return *this->getObject(); } + T* operator*() { return this->getObject(); } T* operator->() { return this->getObject(); } |
