mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-28 19:31:58 +00:00
Fix unit test on FreeBSD. We need to make sure there is enough space to save the pointer even if the memory returned from malloc was already aligned.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78805 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
e2b16504be
commit
5232f418c6
@ -108,7 +108,7 @@ public:
|
||||
void *MemBase = malloc(Size + Alignment - 1 + sizeof(void*));
|
||||
|
||||
// Make the slab.
|
||||
MemSlab *Slab = (MemSlab*)(((uintptr_t)MemBase + Alignment - 1) &
|
||||
MemSlab *Slab = (MemSlab*)(((uintptr_t)MemBase+sizeof(void*)+Alignment-1) &
|
||||
~(uintptr_t)(Alignment - 1));
|
||||
Slab->Size = Size;
|
||||
Slab->NextPtr = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user