Changeset 247281 in webkit
- Timestamp:
- Jul 9, 2019 2:49:21 PM (5 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r247280 r247281 1 2019-07-09 Saagar Jha <saagarjha@apple.com> 2 3 WKObject's minimum object alignment needs to be larger 4 https://bugs.webkit.org/show_bug.cgi?id=199523 5 6 Reviewed by Alex Christensen. 7 8 WKObject's wrapped objects are currently constructed at addresses aligned to 8-byte boundaries, but some 9 classes have more stringent requirements. By querying std::aligned_storage for the alignment of an object 10 larger than anything we can construct, we should be able to satisfy alignment for any of WebKit's types. 11 12 * Shared/Cocoa/APIObject.mm: Use std::aligned_storage in conjunction with alignof to determine 13 minimumObjectAlignment, instead of hardcoding 8. 14 1 15 2019-07-09 Megan Gardner <megan_gardner@apple.com> 2 16 -
trunk/Source/WebKit/Shared/Cocoa/APIObject.mm
r246224 r247281 91 91 #endif 92 92 93 static const size_t minimumObjectAlignment = 8;93 static const size_t minimumObjectAlignment = alignof(std::aligned_storage<std::numeric_limits<size_t>::max()>::type); 94 94 static_assert(minimumObjectAlignment >= alignof(void*), "Objects should always be at least pointer-aligned."); 95 95 static const size_t maximumExtraSpaceForAlignment = minimumObjectAlignment - alignof(void*);
Note: See TracChangeset
for help on using the changeset viewer.