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.

llvm-svn: 78805
This commit is contained in:
Benjamin Kramer 2009-08-12 12:31:02 +00:00
parent 5ce04c066b
commit a191584fca

View File

@ -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;