diff options
| author | Reid Kleckner <reid@kleckner.net> | 2009-07-25 21:26:02 +0000 |
|---|---|---|
| committer | Reid Kleckner <reid@kleckner.net> | 2009-07-25 21:26:02 +0000 |
| commit | b34de52d044f9aa5c2a4d97a293532fb8e7224df (patch) | |
| tree | 956480aceff06b421f0ab357919fd759843b3712 /lib/Support | |
| parent | 4c530ee667b91ee9ffbe1d5614efa48c5bde903d (diff) | |
| download | external_llvm-b34de52d044f9aa5c2a4d97a293532fb8e7224df.zip external_llvm-b34de52d044f9aa5c2a4d97a293532fb8e7224df.tar.gz external_llvm-b34de52d044f9aa5c2a4d97a293532fb8e7224df.tar.bz2 | |
Added a test and fixed a bug in BumpPtrAllocator relating to large alignment
values. Hopefully this fixes PR4622.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77088 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support')
| -rw-r--r-- | lib/Support/Allocator.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Support/Allocator.cpp b/lib/Support/Allocator.cpp index 230c421..36da443 100644 --- a/lib/Support/Allocator.cpp +++ b/lib/Support/Allocator.cpp @@ -95,8 +95,8 @@ void *BumpPtrAllocator::Allocate(size_t Size, size_t Alignment) { } // If Size is really big, allocate a separate slab for it. - if (Size > SizeThreshold) { - size_t PaddedSize = Size + sizeof(MemSlab) + Alignment - 1; + size_t PaddedSize = Size + sizeof(MemSlab) + Alignment - 1; + if (PaddedSize > SizeThreshold) { MemSlab *NewSlab = Allocator.Allocate(PaddedSize); // Put the new slab after the current slab, since we are not allocating |
