[JSC] Remove gcc warnings on mips and armv7
[WebKit-https.git] / Source / bmalloc / bmalloc / IsoPageInlines.h
index 0c47864..ac57266 100644 (file)
@@ -188,7 +188,10 @@ FreeList IsoPage<Config>::startAllocating()
         char* cellByte = reinterpret_cast<char*>(this) + index * Config::objectSize;
         if (verbose)
             fprintf(stderr, "%p: putting %p on free list.\n", this, cellByte);
-        FreeCell* cell = reinterpret_cast<FreeCell*>(cellByte);
+
+        static_assert(!(Config::objectSize % alignof(FreeCell)), "Config::objectSize should respect alignment of FreeCell");
+        static_assert(!(alignof(IsoPage<Config>) % alignof(FreeCell)), "Alignment of IsoPage<Config> should match that of FreeCell");
+        FreeCell* cell = bitwise_cast<FreeCell*>(cellByte);
         cell->setNext(head, secret);
         head = cell;
         bytes += Config::objectSize;