From f7e02a0cabe78bb20d3b27a1337c266399f93c41 Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Thu, 1 Mar 2012 22:10:16 +0000 Subject: BumpPtrAllocator: Make sure threshold cannot be initialized with a value smaller than the slab size. This replaces r151834 with a simpler fix. llvm-svn: 151842 --- llvm/unittests/Support/AllocatorTest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/unittests/Support/AllocatorTest.cpp') diff --git a/llvm/unittests/Support/AllocatorTest.cpp b/llvm/unittests/Support/AllocatorTest.cpp index bc5bd3dc407..8b463c11dfc 100644 --- a/llvm/unittests/Support/AllocatorTest.cpp +++ b/llvm/unittests/Support/AllocatorTest.cpp @@ -98,7 +98,7 @@ TEST(AllocatorTest, TestSmallSlabSize) { BumpPtrAllocator Alloc(128); Alloc.Allocate(200, 0); - EXPECT_EQ(1U, Alloc.GetNumSlabs()); + EXPECT_EQ(2U, Alloc.GetNumSlabs()); } // Mock slab allocator that returns slabs aligned on 4096 bytes. There is no -- cgit v1.2.3