[webkit-changes] [WebKit/WebKit] 1bcc99: CheckedPtr should require FastMalloc, Part 1
geoffreygaren
noreply at github.com
Sun Mar 31 21:33:26 PDT 2024
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 1bcc994da88e880d58bef947d62b6c89bd290b90
https://github.com/WebKit/WebKit/commit/1bcc994da88e880d58bef947d62b6c89bd290b90
Author: Geoffrey Garen <ggaren at apple.com>
Date: 2024-03-31 (Sun, 31 Mar 2024)
Changed paths:
M Source/WTF/wtf/CheckedPtr.h
M Source/WTF/wtf/FastMalloc.h
M Source/WTF/wtf/StdLibExtras.h
M Source/WTF/wtf/UniqueRef.h
M Source/WebCore/platform/ScrollableArea.cpp
M Source/WebCore/platform/graphics/TextRun.cpp
M Source/WebCore/rendering/LegacyRootInlineBox.cpp
M Source/WebCore/rendering/MarkedText.h
M Source/WebCore/rendering/RegionContext.h
M Source/WebCore/rendering/RenderLayerCompositor.cpp
M Source/WebCore/rendering/RenderObject.cpp
M Source/WebKit/Shared/WebPreferencesStore.h
M Source/bmalloc/bmalloc/IsoHeap.h
M Source/bmalloc/bmalloc/IsoHeapInlines.h
M Source/bmalloc/bmalloc/TZoneHeap.h
M Source/bmalloc/bmalloc/TZoneHeapInlines.h
Log Message:
-----------
CheckedPtr should require FastMalloc, Part 1
https://bugs.webkit.org/show_bug.cgi?id=271950
Reviewed by Ryosuke Niwa.
This will enable zombie-mode CheckedPtr.
It's also just good performance hygiene.
* Source/WTF/wtf/CheckedPtr.h:
(WTF::CheckedPtr::refIfNotNull):
(WTF::CheckedPtr::derefIfNotNull): Use static_assert to verify use of FastMalloc.
This is a good spot because it provides a complete type definition for T and
it's our lowest level funnel. (Not enabled yet because there are a few complex
cases left to work through.)
(WTF::CheckedPtr::operator UnspecifiedBoolType const): Deleted.
(WTF::CheckedPtr::unspecifiedBoolTypeInstance const): Deleted. Took the
opportunity to remove these. 'explicit operator bool()' obsoletes them.
* Source/WTF/wtf/FastMalloc.h: Capitalized our type name since that's WebKit
style. Renamed to WTFIsFastAllocated to match the macro WTF_MAKE_FAST_ALLOCATED.
* Source/WTF/wtf/StdLibExtras.h:
(WTF::makeUnique):
(WTF::makeUniqueWithoutRefCountedCheck):
(WTF::makeUniqueWithoutFastMallocCheck): Adopted new typename for
WTFIsFastAllocated and added a little more instruction to the error message.
* Source/WTF/wtf/UniqueRef.h:
(WTF::makeUniqueRef): Ditto
* Source/bmalloc/bmalloc/IsoHeap.h:
* Source/bmalloc/bmalloc/IsoHeapInlines.h:
* Source/bmalloc/bmalloc/TZoneHeap.h:
* Source/bmalloc/bmalloc/TZoneHeapInlines.h: Ditto
* Source/WebCore/platform/ScrollableArea.cpp:
* Source/WebCore/platform/graphics/TextRun.cpp:
* Source/WebCore/rendering/LegacyRootInlineBox.cpp:
* Source/WebCore/rendering/MarkedText.h:
* Source/WebCore/rendering/RegionContext.h: Adopt FastMalloc.
* Source/WebCore/rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::adjustOverflowScrollbarContainerLayers): Fixed
a type safety bug uncovered by removing the UnspecifiedBoolType operator. This
code certainly did something before, but probably not what the author expected! :P
* Source/WebCore/rendering/RenderObject.cpp:
* Source/WebKit/Shared/WebPreferencesStore.h: Adopt FastMalloc.
Canonical link: https://commits.webkit.org/276869@main
To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications
More information about the webkit-changes
mailing list