[webkit-reviews] review requested: [Bug 68629] Enable -Wcast-align for Apple Mac port : [Attachment 108350] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Sep 22 09:45:51 PDT 2011


David Kilzer (ddkilzer) <ddkilzer at webkit.org> has asked  for review:
Bug 68629: Enable -Wcast-align for Apple Mac port
https://bugs.webkit.org/show_bug.cgi?id=68629

Attachment 108350: Patch
https://bugs.webkit.org/attachment.cgi?id=108350&action=review

------- Additional Comments from David Kilzer (ddkilzer) <ddkilzer at webkit.org>
View in context: https://bugs.webkit.org/attachment.cgi?id=108350&action=review


> Source/WebCore/rendering/RenderLayer.cpp:128
> -    renderArena->free(*(size_t *)this, this);
> +    renderArena->free(*reinterpret_cast<size_t *>(this), this);

Note that all architectures except MIPS, ARMv5E, ARMv5TE and ARMv5TEJ use an
alignment of 4.  And BidiRun::destroy() also uses reinterpret_cast.  Should
this use (sizeof(size_t) - 1) instead of 3 when defining ARENA_ALIGN_MASK in
Arena.h?

 #ifdef WTF_USE_ARENA_ALLOC_ALIGNMENT_INTEGER
 #define ARENA_ALIGN_MASK (sizeof(WTF::AllocAlignmentInteger) - 1)
 #else
-#define ARENA_ALIGN_MASK 3
+#define ARENA_ALIGN_MASK (sizeof(size_t) - 1)
 #endif


More information about the webkit-reviews mailing list