OSDN Git Service

Fix unit test on FreeBSD. We need to make sure there is enough space to save the...
authorBenjamin Kramer <benny.kra@googlemail.com>
Wed, 12 Aug 2009 12:31:02 +0000 (12:31 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Wed, 12 Aug 2009 12:31:02 +0000 (12:31 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78805 91177308-0d34-0410-b5e6-96231b3b80d8

unittests/Support/AllocatorTest.cpp

index 463760d..2a01f3a 100644 (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;