aboutsummaryrefslogtreecommitdiff
path: root/lib/Support/Allocator.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Support/Allocator.cpp')
-rw-r--r--lib/Support/Allocator.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Support/Allocator.cpp b/lib/Support/Allocator.cpp
index ef40e47d98..90df262336 100644
--- a/lib/Support/Allocator.cpp
+++ b/lib/Support/Allocator.cpp
@@ -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);