From 8be3a8f7dc10dbc49dfcdeca572677ef1e00f714 Mon Sep 17 00:00:00 2001 From: Tycho Date: Fri, 23 May 2014 17:18:11 +0100 Subject: Implemented Allocation Pool use by cChunkData --- src/ChunkData.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/ChunkData.cpp') diff --git a/src/ChunkData.cpp b/src/ChunkData.cpp index 86b0c431c..31de364b9 100644 --- a/src/ChunkData.cpp +++ b/src/ChunkData.cpp @@ -4,7 +4,7 @@ cChunkData cChunkData::Copy() const { - cChunkData copy; + cChunkData copy(m_Pool); for (int i = 0; i < CHUNK_SECTION_NUM; i++) { if (m_Sections[i] != NULL) @@ -360,14 +360,14 @@ void cChunkData::SetSkyLight (const NIBBLETYPE * a_src) cChunkData::sChunkSection * cChunkData::Allocate() const { // TODO: use a allocation pool - return new cChunkData::sChunkSection; + return m_Pool.Allocate(); } void cChunkData::Free(cChunkData::sChunkSection * ptr) const { - delete ptr; + m_Pool.Free(ptr); } -- cgit v1.2.3