New MemoryPool tool

This commit is contained in:
Guilhem Lavaux 2012-05-18 18:16:13 -04:00
parent 7bd2ccbee4
commit 59de27a696
3 changed files with 115 additions and 0 deletions

19
sample/testPool.cpp Normal file
View file

@ -0,0 +1,19 @@
#include "pool.hpp"
using namespace CosmoTool;
int main(int argc, char **argv)
{
MemoryPool<int> pool(1024);
int **j = new int *[3000];
for (int i = 0; i < 3000; i++)
{
j[i] = pool.alloc();
j[i][0] = i;
}
pool.free_all();
return 0;
}