forked from naclander/openmugen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MemManager.h
61 lines (49 loc) · 1.2 KB
/
MemManager.h
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#ifndef __MEMMANAGER__H
#define __MEMMANAGER__H
enum {
MAINMENU=0,
STAGE=1,
ENGINE=2,
P1=3,
P2=4,
P3=5,
P4=6
};
class CAllocater
{
char strAllocName[255];
size_t nAllocSize;
size_t nAllocNumber;
size_t nMemListSize;
MEMLIST *lpMemList;
bool bFree;
enum { FREE=0x00,
ALLOC=0xff
};
void SetMemListFree(MEMLIST* lpList);
public:
//Constructor & Desctructor
CAllocater(char *strName);
~CAllocater();
void ShowMemUsage();
void* Alloc(size_t nSize,int nMemInit = 0);
void* Realloc(void *CurMem,size_t nSize);
void Free(void *CurMem);
void FreeAllocater();
void ResetAllocater();
size_t GetMemUsage(){return nAllocSize;}
char *GetName(){return strAllocName;}
};
class CMemManager
{
CAllocater *lpAlloc[7];
public:
//Constructor & Desctructor
CMemManager();
~CMemManager();
void InitManager();
CAllocater *GetAllocater(int nAllocater);
void FreeManager();
size_t GetMemUsage();
};
#endif