[webkit-reviews] review granted: [Bug 179518] Increase the alignment requirement of WKObject's wrapped C++ object : [Attachment 326643] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Nov 11 00:07:05 PST 2017


mitz at webkit.org has granted Tim Horton <thorton at apple.com>'s request for
review:
Bug 179518: Increase the alignment requirement of WKObject's wrapped C++ object
https://bugs.webkit.org/show_bug.cgi?id=179518

Attachment 326643: Patch

https://bugs.webkit.org/attachment.cgi?id=326643&action=review




--- Comment #8 from mitz at webkit.org ---
Comment on attachment 326643
  --> https://bugs.webkit.org/attachment.cgi?id=326643
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=326643&action=review

> Source/WebKit/Shared/Cocoa/APIObject.mm:87
> +

I'd put the assertion before the subtraction it's guarding against underflow.

> Source/WebKit/Shared/Cocoa/APIObject.mm:111
> +    void* api = object_getIndexedIvars(obj);
> +    api = std::align(minimumObjectAlignment, size, api, spaceAvailable);
> +    return *static_cast<API::Object*>(api);

I’d have probably written this entire function as just two statements. Can you
at least combine 109 with 110, or is there something about std::align that
makes that impossible?


More information about the webkit-reviews mailing list