Files
tp/include/JSystem/JKernel/JKRAramHeap.h
T
Jcw87 221f40e609 Remove #includes from headers (#334)
* add "global.h" to files that use it

* add MSL_C includes to files that use them

* remove dolphin includes from headers that don't need them

* remove JSupport includes from headers that don't need them

* remove JKernel includes from headers that don't need them

* remove JUtility includes from headers that don't need them

* remove J3D includes from headers that don't need them

* remove J2D includes from headers that don't need them

* remove JAudio2 includes from headers that don't need them

* remove Z2AudioLib includes from headers that don't need them

* remove JMessage includes from headers that don't need them

* remove JParticle includes from headers that don't need them

* remove SComponent includes from headers that don't need them

* remove dol includes from headers that don't need them

* sort includes
2023-05-12 12:10:14 -07:00

53 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"
#include "dolphin/types.h"
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);
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 */