summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/AllocationPool.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/AllocationPool.h b/src/AllocationPool.h
index b8862e7df..e4f1427f6 100644
--- a/src/AllocationPool.h
+++ b/src/AllocationPool.h
@@ -19,6 +19,16 @@ class cAllocationPool {
cAllocationPool(std::auto_ptr<cStarvationCallbacks> a_Callbacks) :
m_Callbacks(a_Callbacks)
{
+ for(int i = 0; i < NumElementsInReserve; i++)
+ {
+ void * space = malloc(sizeof(T));
+ if (space == NULL)
+ {
+ m_Callbacks->OnStartingUsingBuffer();
+ break;
+ }
+ m_FreeList.push_front(space);
+ }
}
~cAllocationPool()