2021-01-08 14:47:41 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
namespace base
|
|
|
|
{
|
|
|
|
class cMemoryManager
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
cMemoryManager();
|
|
|
|
void* Allocate(uint32 size);
|
|
|
|
void* AllocateAligned(uint32 size);
|
|
|
|
void* Realloc(void* buf, uint32 newSize, bool unk);
|
|
|
|
void Free(void* buf);
|
|
|
|
bool IsFree(void* buf);
|
|
|
|
};
|
|
|
|
|
|
|
|
class cMainMemoryManager : public cMemoryManager
|
|
|
|
{
|
|
|
|
static cMainMemoryManager* m_pInstance;
|
|
|
|
static void Init(void*, uint32);
|
|
|
|
|
|
|
|
public:
|
|
|
|
cMainMemoryManager();
|
|
|
|
static cMainMemoryManager *Instance()
|
|
|
|
{
|
|
|
|
static cMainMemoryManager instance;
|
|
|
|
return &instance;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
class cMemoryBlock
|
|
|
|
{
|
|
|
|
// TODO
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2021-01-08 15:21:07 +00:00
|
|
|
void* operator new(size_t size);
|
|
|
|
void* operator new[](size_t size);
|
2021-01-08 14:47:41 +00:00
|
|
|
void operator delete(void* buf);
|
|
|
|
void operator delete[](void* buf);
|