[webkit-reviews] review denied: [Bug 81570] Properly align members in WebInputEvent and subclasses to make Valgrind happy : [Attachment 132684] patch to fix the bug

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Mar 19 16:29:02 PDT 2012


Tony Chang <tony at chromium.org> has denied Lei Zhang <thestig at chromium.org>'s
request for review:
Bug 81570: Properly align members in WebInputEvent and subclasses to make
Valgrind happy
https://bugs.webkit.org/show_bug.cgi?id=81570

Attachment 132684: patch to fix the bug
https://bugs.webkit.org/attachment.cgi?id=132684&action=review

------- Additional Comments from Tony Chang <tony at chromium.org>
View in context: https://bugs.webkit.org/attachment.cgi?id=132684&action=review


You're right, memset won't work in this case.  Reordering seems unavoidable
considering how content/public/common/webkit_param_traits.h handles
WebInputEvent*.  It might still be worth packing to 4 bytes to avoid having
padding ints.

> WebKit/chromium/public/WebInputEvent.h:225
> +    sizeof(WebInputEvent) == (sizeof(WebInputEvent::timeStampSeconds) +
> +				 sizeof(WebInputEvent::size) +

We normally just make a reference struct and make sure the real object has the
same size as the reference struct.  See for example the SameSizeAsCSSValue
class in WebKit/Source/WebCore/css/CSSValue.cpp.  For your SameSizeAs* class,
you can just put doubles in them.


More information about the webkit-reviews mailing list