forked from qt-creator/qt-creator
Released the memory allocated in the memory pool when backtracking from Parser::parseTemplateId().
This commit is contained in:
@@ -110,6 +110,19 @@ void *MemoryPool::allocate_helper(size_t size)
|
||||
return addr;
|
||||
}
|
||||
|
||||
MemoryPool::State MemoryPool::state() const
|
||||
{ return State(ptr, _blockCount); }
|
||||
|
||||
void MemoryPool::rewind(const State &state)
|
||||
{
|
||||
if (_blockCount == state.blockCount && state.ptr < ptr) {
|
||||
if (_initializeAllocatedMemory)
|
||||
memset(state.ptr, '\0', ptr - state.ptr);
|
||||
|
||||
ptr = state.ptr;
|
||||
}
|
||||
}
|
||||
|
||||
Managed::Managed()
|
||||
{ }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user