summaryrefslogtreecommitdiffstats
path: root/src/ChunkData.cpp
diff options
context:
space:
mode:
authorTycho <work.tycho+git@gmail.com>2014-05-23 18:18:11 +0200
committerTycho <work.tycho+git@gmail.com>2014-05-23 18:18:11 +0200
commit8be3a8f7dc10dbc49dfcdeca572677ef1e00f714 (patch)
tree204743272c8948237a8322027510f5240bfdb71e /src/ChunkData.cpp
parentUse placement new to initalise objects (diff)
downloadcuberite-8be3a8f7dc10dbc49dfcdeca572677ef1e00f714.tar
cuberite-8be3a8f7dc10dbc49dfcdeca572677ef1e00f714.tar.gz
cuberite-8be3a8f7dc10dbc49dfcdeca572677ef1e00f714.tar.bz2
cuberite-8be3a8f7dc10dbc49dfcdeca572677ef1e00f714.tar.lz
cuberite-8be3a8f7dc10dbc49dfcdeca572677ef1e00f714.tar.xz
cuberite-8be3a8f7dc10dbc49dfcdeca572677ef1e00f714.tar.zst
cuberite-8be3a8f7dc10dbc49dfcdeca572677ef1e00f714.zip
Diffstat (limited to '')
-rw-r--r--src/ChunkData.cpp6
1 files changed, 3 insertions, 3 deletions
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);
}