1
0

Fill with buffer on startup

This commit is contained in:
Tycho 2014-06-14 17:59:47 +01:00
parent 8bf37f3dd7
commit bff76f201f

View File

@ -19,6 +19,16 @@ class cAllocationPool {
cAllocationPool(std::auto_ptr<cStarvationCallbacks> a_Callbacks) : cAllocationPool(std::auto_ptr<cStarvationCallbacks> a_Callbacks) :
m_Callbacks(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() ~cAllocationPool()