mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-23 14:03:14 +00:00
BumpPtrAllocator::Reset() doesn't need to allocate anything. (Thanks, Jakob)
llvm-svn: 101138
This commit is contained in:
parent
dd1243fb89
commit
a4c5712b41
@ -70,8 +70,8 @@ void BumpPtrAllocator::DeallocateSlabs(MemSlab *Slab) {
|
||||
/// Reset - Deallocate all but the current slab and reset the current pointer
|
||||
/// to the beginning of it, freeing all memory allocated so far.
|
||||
void BumpPtrAllocator::Reset() {
|
||||
if (!CurSlab) // Start a new slab if we didn't allocate one already.
|
||||
StartNewSlab();
|
||||
if (!CurSlab)
|
||||
return;
|
||||
DeallocateSlabs(CurSlab->NextPtr);
|
||||
CurSlab->NextPtr = 0;
|
||||
CurPtr = (char*)(CurSlab + 1);
|
||||
|
Loading…
x
Reference in New Issue
Block a user