Allocate new block, if we're at the end of current one.

This commit is contained in:
Bartosz Taudul 2019-02-15 02:04:37 +01:00
parent 7b023e533d
commit 23d12d2633

View File

@ -83,6 +83,13 @@ public:
m_offset += size;
return ret;
}
else if( size <= BlockSize && BlockSize - m_offset <= 1024 )
{
DoAlloc();
void* ret = m_ptr + m_offset;
m_offset += size;
return ret;
}
else
{
memUsage.fetch_add( size );