wavelength 1.0.0
Loading...
Searching...
No Matches
Pool.h
Go to the documentation of this file.
1#pragma once
2
10class Pool {
11public:
12 Pool() : mElems(0), mFree(0), mSize(0), mNum(0) {
13 }
14
21 void *Alloc();
22
29 void Free(void *elem);
30
31private:
33 struct FreeElem {
34 FreeElem *mNext;
35 };
36
37 char *mElems;
38 FreeElem *mFree;
39 int mSize;
40 int mNum;
41};
void * Alloc()
Take an element.
void Free(void *elem)
Return an element, which must lie in the pool's block.
Pool()
Definition Pool.h:12