mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-30 02:25:19 +00:00
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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215841 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user