summaryrefslogtreecommitdiffstats
path: root/src/AllocationPool.h
diff options
context:
space:
mode:
authorTycho <work.tycho+git@gmail.com>2014-06-14 20:05:02 +0200
committerTycho <work.tycho+git@gmail.com>2014-06-14 20:05:02 +0200
commit6b99e556462fdbdf6a265c014fb03f070b0f1b25 (patch)
tree96e70b12604c3a6733b15ee27083faff6543be92 /src/AllocationPool.h
parentfixed spaces (diff)
downloadcuberite-6b99e556462fdbdf6a265c014fb03f070b0f1b25.tar
cuberite-6b99e556462fdbdf6a265c014fb03f070b0f1b25.tar.gz
cuberite-6b99e556462fdbdf6a265c014fb03f070b0f1b25.tar.bz2
cuberite-6b99e556462fdbdf6a265c014fb03f070b0f1b25.tar.lz
cuberite-6b99e556462fdbdf6a265c014fb03f070b0f1b25.tar.xz
cuberite-6b99e556462fdbdf6a265c014fb03f070b0f1b25.tar.zst
cuberite-6b99e556462fdbdf6a265c014fb03f070b0f1b25.zip
Diffstat (limited to '')
-rw-r--r--src/AllocationPool.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/AllocationPool.h b/src/AllocationPool.h
index 9144c2eac..9bb44ff1f 100644
--- a/src/AllocationPool.h
+++ b/src/AllocationPool.h
@@ -4,7 +4,8 @@
#include <memory>
template<class T, size_t NumElementsInReserve>
-class cAllocationPool {
+class cAllocationPool
+{
public:
class cStarvationCallbacks
@@ -17,7 +18,7 @@ class cAllocationPool {
};
cAllocationPool(std::auto_ptr<cStarvationCallbacks> a_Callbacks) :
- m_Callbacks(a_Callbacks)
+ m_Callbacks(a_Callbacks)
{
for (size_t i = 0; i < NumElementsInReserve; i++)
{
@@ -40,7 +41,7 @@ class cAllocationPool {
}
}
- T* Allocate()
+ T * Allocate()
{
if (m_FreeList.size() <= NumElementsInReserve)
{
@@ -61,11 +62,11 @@ class cAllocationPool {
}
}
// placement new, used to initalize the object
- T* ret = new (m_FreeList.front()) T;
+ T * ret = new (m_FreeList.front()) T;
m_FreeList.pop_front();
return ret;
}
- void Free(T* ptr)
+ void Free(T * ptr)
{
if (ptr == NULL)
{