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
This commit is contained in:
Reid Kleckner
2009-07-25 21:26:02 +00:00
parent b4fc419d83
commit 7d509134dc
2 changed files with 50 additions and 2 deletions
+2 -2
View File
@@ -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