1
0

Implemented Allocation Pool use by cChunkData

This commit is contained in:
Tycho
2014-05-23 17:18:11 +01:00
parent 6991c2dd84
commit 8be3a8f7dc
11 changed files with 125 additions and 45 deletions

View File

@@ -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);
}