summaryrefslogtreecommitdiffstats
path: root/src/AllocationPool.h
diff options
context:
space:
mode:
authorTycho <work.tycho+git@gmail.com>2014-06-14 21:24:52 +0200
committerTycho <work.tycho+git@gmail.com>2014-06-14 21:24:52 +0200
commit8a2aa6cb169563c7df752821e032b1cab1bac5d1 (patch)
treef2665cd3382f32a4daf9cd0f8ec9369021f36898 /src/AllocationPool.h
parentRemoved spaces (diff)
downloadcuberite-8a2aa6cb169563c7df752821e032b1cab1bac5d1.tar
cuberite-8a2aa6cb169563c7df752821e032b1cab1bac5d1.tar.gz
cuberite-8a2aa6cb169563c7df752821e032b1cab1bac5d1.tar.bz2
cuberite-8a2aa6cb169563c7df752821e032b1cab1bac5d1.tar.lz
cuberite-8a2aa6cb169563c7df752821e032b1cab1bac5d1.tar.xz
cuberite-8a2aa6cb169563c7df752821e032b1cab1bac5d1.tar.zst
cuberite-8a2aa6cb169563c7df752821e032b1cab1bac5d1.zip
Diffstat (limited to 'src/AllocationPool.h')
-rw-r--r--src/AllocationPool.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/AllocationPool.h b/src/AllocationPool.h
index 9c833302f..5d749a79e 100644
--- a/src/AllocationPool.h
+++ b/src/AllocationPool.h
@@ -13,14 +13,14 @@ public:
virtual ~cStarvationCallbacks() {}
/** Is called when the reserve buffer starts to be used **/
- virtual void OnStartingUsingBuffer() = 0;
+ virtual void OnStartUsingReserve() = 0;
/** Is called once the reserve buffer has returned to normal size **/
- virtual void OnStopUsingBuffer() = 0;
+ virtual void OnEndUsingReserve() = 0;
/** Is called when the allocation pool is unable to allocate memory. Will be repeatedly
called if it does not free sufficient memory **/
- virtual void OnBufferEmpty() = 0;
+ virtual void OnOutOfReserve() = 0;
};
virtual ~cAllocationPool() {}
@@ -47,7 +47,7 @@ class cListAllocationPool : public cAllocationPool<T>
void * space = malloc(sizeof(T));
if (space == NULL)
{
- m_Callbacks->OnStartingUsingBuffer();
+ m_Callbacks->OnStartUsingReserve();
break;
}
m_FreeList.push_front(space);
@@ -74,11 +74,11 @@ class cListAllocationPool : public cAllocationPool<T>
}
else if (m_FreeList.size() == NumElementsInReserve)
{
- m_Callbacks->OnStartingUsingBuffer();
+ m_Callbacks->OnStartUsingReserve();
}
else if (m_FreeList.empty())
{
- m_Callbacks->OnBufferEmpty();
+ m_Callbacks->OnOutOfReserve();
// Try again until the memory is avalable
return Allocate();
}
@@ -99,7 +99,7 @@ class cListAllocationPool : public cAllocationPool<T>
m_FreeList.push_front(a_ptr);
if (m_FreeList.size() == NumElementsInReserve)
{
- m_Callbacks->OnStopUsingBuffer();
+ m_Callbacks->OnEndUsingReserve();
}
}