diff options
author | Hans Wennborg <hans@hanshq.net> | 2014-08-17 18:31:18 +0000 |
---|---|---|
committer | Hans Wennborg <hans@hanshq.net> | 2014-08-17 18:31:18 +0000 |
commit | d47b1d76fd5d9354e70f3f9942d54cf73c7495ce (patch) | |
tree | f7f0c91d84f7c40e0df9cf2c12f8aa75f79772e6 /llvm/unittests/Support/AllocatorTest.cpp | |
parent | 52d23d4ceee1d6706be702fa791f50a77f1f2245 (diff) | |
download | bcm5719-llvm-d47b1d76fd5d9354e70f3f9942d54cf73c7495ce.tar.gz bcm5719-llvm-d47b1d76fd5d9354e70f3f9942d54cf73c7495ce.zip |
BumpPtrAllocator: remove 'no slabs allocated yet' check
We already handle the no-slabs case when checking whether the current slab
is large enough: if no slabs have been allocated, CurPtr and End are both 0.
alignPtr(0), will still be 0, and so "if (Ptr + Size <= End)" fails.
Differential Revision: http://reviews.llvm.org/D4943
llvm-svn: 215841
Diffstat (limited to 'llvm/unittests/Support/AllocatorTest.cpp')
-rw-r--r-- | llvm/unittests/Support/AllocatorTest.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
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 |