2022-10-09 05:13:17 +00:00
|
|
|
#ifndef _CMEDIUMALLOCPOOL
|
|
|
|
#define _CMEDIUMALLOCPOOL
|
2022-09-20 04:35:24 +00:00
|
|
|
|
|
|
|
#include <rstl/list.hpp>
|
|
|
|
|
|
|
|
class CMediumAllocPool {
|
|
|
|
public:
|
2022-10-09 05:13:17 +00:00
|
|
|
struct SMediumAllocPuddle {
|
|
|
|
u8 unk;
|
|
|
|
void* x4_mainData;
|
|
|
|
void* x8_bookKeeping;
|
|
|
|
void* xc_cachedBookKeepingOffset;
|
|
|
|
int x10_;
|
|
|
|
int x14_numBlocks;
|
|
|
|
int x18_numAllocs;
|
|
|
|
int x1c_numEntries;
|
|
|
|
};
|
2022-09-20 04:35:24 +00:00
|
|
|
|
2022-10-09 05:13:17 +00:00
|
|
|
rstl::list< SMediumAllocPuddle > x0_list;
|
|
|
|
/*rstl::list_node<SMediumAllocPuddle>* x18_lastNodePrev; */
|
|
|
|
void* x18_lastNodePrev;
|
|
|
|
void* Alloc(uint size);
|
|
|
|
bool HasPuddles() const;
|
|
|
|
void AddPuddle(uint, void*, int);
|
|
|
|
void ClearPuddles();
|
2022-09-20 04:35:24 +00:00
|
|
|
|
2022-10-09 05:13:17 +00:00
|
|
|
s32 Free(const void* ptr);
|
2022-09-20 04:35:24 +00:00
|
|
|
|
2022-10-09 05:13:17 +00:00
|
|
|
uint GetTotalEntries();
|
|
|
|
uint GetNumBlocksAvailable();
|
|
|
|
uint GetNumAllocs();
|
2022-09-20 04:35:24 +00:00
|
|
|
};
|
|
|
|
|
2022-10-09 05:13:17 +00:00
|
|
|
#endif // _CMEDIUMALLOCPOOL
|