mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-25 21:18:19 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user