summaryrefslogtreecommitdiffstats
path: root/contrib/llvm/lib/Support/Allocator.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm/lib/Support/Allocator.cpp')
-rw-r--r--contrib/llvm/lib/Support/Allocator.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/contrib/llvm/lib/Support/Allocator.cpp b/contrib/llvm/lib/Support/Allocator.cpp
index 215b0f2..b897830 100644
--- a/contrib/llvm/lib/Support/Allocator.cpp
+++ b/contrib/llvm/lib/Support/Allocator.cpp
@@ -22,8 +22,8 @@ namespace llvm {
BumpPtrAllocator::BumpPtrAllocator(size_t size, size_t threshold,
SlabAllocator &allocator)
- : SlabSize(size), SizeThreshold(threshold), Allocator(allocator),
- CurSlab(0), BytesAllocated(0) { }
+ : SlabSize(size), SizeThreshold(std::min(size, threshold)),
+ Allocator(allocator), CurSlab(0), BytesAllocated(0) { }
BumpPtrAllocator::~BumpPtrAllocator() {
DeallocateSlabs(CurSlab);
OpenPOWER on IntegriCloud