summaryrefslogtreecommitdiffstats
path: root/src/leeds/base/memoryManager.h
blob: 97ee4a43a73b3e8696c5d653f8b14ff7eab5abc0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#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
	};
}

void* operator new(uint32 size);
void* operator new[](uint32 size);
void operator delete(void* buf);
void operator delete[](void* buf);