summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
Diffstat (limited to 'llvm')
-rw-r--r--llvm/include/llvm/Support/Allocator.h3
-rw-r--r--llvm/unittests/Support/AllocatorTest.cpp2
2 files changed, 1 insertions, 4 deletions
diff --git a/llvm/include/llvm/Support/Allocator.h b/llvm/include/llvm/Support/Allocator.h
index 7a7e4c0a13e..f39fd10b024 100644
--- a/llvm/include/llvm/Support/Allocator.h
+++ b/llvm/include/llvm/Support/Allocator.h
@@ -201,9 +201,6 @@ public:
/// \brief Allocate space at the specified alignment.
void *Allocate(size_t Size, size_t Alignment) {
- if (!CurPtr) // Start a new slab if we haven't allocated one already.
- StartNewSlab();
-
// Keep track of how many bytes we've allocated.
BytesAllocated += Size;
diff --git a/llvm/unittests/Support/AllocatorTest.cpp b/llvm/unittests/Support/AllocatorTest.cpp
index 0fc84c7613f..dc92ff9ef03 100644
--- a/llvm/unittests/Support/AllocatorTest.cpp
+++ b/llvm/unittests/Support/AllocatorTest.cpp
@@ -112,7 +112,7 @@ TEST(AllocatorTest, TestSmallSlabSize) {
BumpPtrAllocator Alloc;
Alloc.Allocate(8000, 0);
- EXPECT_EQ(2U, Alloc.GetNumSlabs());
+ EXPECT_EQ(1U, Alloc.GetNumSlabs());
}
// Mock slab allocator that returns slabs aligned on 4096 bytes. There is no
OpenPOWER on IntegriCloud