forked from asavine/CompFinance
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathxlmemorymanager.h
59 lines (46 loc) · 1.19 KB
/
xlmemorymanager.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
///***************************************************************************
// File: MemoryManager.h
//
// Purpose: Class definition for the memory manager used in the framework
// library. Includes exported methods for accessing the class
// in C.
//
// Platform: Microsoft Windows
//
///***************************************************************************
#pragma once
#ifdef __cplusplus
#include "xlMemoryPool.h"
//
// Total number of memory allocation pools to manage
//
#define MEMORYPOOLS 4
class MemoryManager
{
public:
MemoryManager(void);
~MemoryManager(void);
static MemoryManager* GetManager();
LPSTR CPP_GetTempMemory(int cByte);
void CPP_FreeAllTempMemory();
private:
MemoryPool* CreateNewPool(DWORD dwThreadID);
MemoryPool* GetMemoryPool(DWORD dwThreadID);
void GrowPools();
int m_impCur; // Current number of pools
int m_impMax; // Max number of mem pools
MemoryPool* m_rgmp; // Storage for the memory pools
};
#endif //__cplusplus
//
// Defines functions for accessing class from a C projects
//
#ifdef __cplusplus
extern "C"
{
#endif
LPSTR MGetTempMemory(int cByte);
void MFreeAllTempMemory();
#ifdef __cplusplus
}
#endif