WebKit Bugzilla
Attachment 373552 Details for
Bug 199523
: WKObject's minimum object alignment needs to be larger
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-199523-20190705162636.patch (text/plain), 1.80 KB, created by
Saagar Jha
on 2019-07-05 16:26:37 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Saagar Jha
Created:
2019-07-05 16:26:37 PDT
Size:
1.80 KB
patch
obsolete
>Subversion Revision: 247182 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index c65bf2c07b6f2fc61b8d3ab178beee012a845cda..903fa4e83a5e3b05f99990c08838d5d5d3811de3 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,17 @@ >+2019-07-05 Saagar Jha <saagarjha@apple.com> >+ >+ WKObject's minimum object alignment needs to be larger >+ https://bugs.webkit.org/show_bug.cgi?id=199523 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ WKObject's wrapped objects are currently constructed at addresses aligned to 8-byte boundaries, but some >+ classes have more stringent requirements. By querying std::aligned_storage for the alignment of an object >+ larger than anything we can construct, we should be able to satisfy alignment for any of WebKit's types. >+ >+ * Shared/Cocoa/APIObject.mm: Use std::aligned_storage in conjunction with alignof to determine >+ minimumObjectAlignment, instead of hardcoding 8. >+ > 2019-07-05 Ryosuke Niwa <rniwa@webkit.org> > > [iOS] Crash in WebKit::WebPage::positionInformation via Range::startPosition >diff --git a/Source/WebKit/Shared/Cocoa/APIObject.mm b/Source/WebKit/Shared/Cocoa/APIObject.mm >index d017e6f773b1ad8794c5e2d6a4aec5de5750f107..57c32b2f9ab21a8bea1af8a0cee9b76ba3e880ee 100644 >--- a/Source/WebKit/Shared/Cocoa/APIObject.mm >+++ b/Source/WebKit/Shared/Cocoa/APIObject.mm >@@ -90,7 +90,7 @@ > #import "_WKApplicationManifestInternal.h" > #endif > >-static const size_t minimumObjectAlignment = 8; >+static const size_t minimumObjectAlignment = alignof(std::aligned_storage<std::numeric_limits<size_t>::max()>::type); > static_assert(minimumObjectAlignment >= alignof(void*), "Objects should always be at least pointer-aligned."); > static const size_t maximumExtraSpaceForAlignment = minimumObjectAlignment - alignof(void*); >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 199523
: 373552