From 8a2aa6cb169563c7df752821e032b1cab1bac5d1 Mon Sep 17 00:00:00 2001 From: Tycho Date: Sat, 14 Jun 2014 20:24:52 +0100 Subject: Changed names of callbacks --- src/AllocationPool.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/AllocationPool.h') 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 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 } 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 m_FreeList.push_front(a_ptr); if (m_FreeList.size() == NumElementsInReserve) { - m_Callbacks->OnStopUsingBuffer(); + m_Callbacks->OnEndUsingReserve(); } } -- cgit v1.2.3