-
Notifications
You must be signed in to change notification settings - Fork 64
/
Copy pathxlMemoryPool.h
36 lines (30 loc) · 947 Bytes
/
xlMemoryPool.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
///***************************************************************************
// File: MemoryPool.h
//
// Purpose: Class definition for the memory pool class used by the
// memory manager. Each pool is a block of memory set
// aside for a specific thread for use in creating temporary
// XLOPER/XLOPER12's in the framework
//
// Platform: Microsoft Windows
//
///***************************************************************************
#pragma once
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
//
// Total amount of memory to allocate for all temporary XLOPERs
//
#define MEMORYSIZE 16777216
class MemoryPool
{
public:
MemoryPool(void);
~MemoryPool(void);
void ClearPool(void);
LPSTR GetTempMemory(int cBytes);
void FreeAllTempMemory();
DWORD m_dwOwner; // ID of ownning thread
char* m_rgchMemBlock; // Memory for temporary XLOPERs
int m_ichOffsetMemBlock; // Offset of next memory block to allocate
};