Bug 285099

Summary: Introduce a CompactVariant for efficient variants of pointers and types smaller than 56 bits
Product: WebKit Reporter: Sam Weinig <sam>
Component: Web Template FrameworkAssignee: Sam Weinig <sam>
Status: RESOLVED FIXED    
Severity: Normal CC: webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Safari 18   
Hardware: Unspecified   
OS: Unspecified   

Sam Weinig
Reported 2024-12-23 05:50:27 PST
Adds `WTF::CompactVariant`. A `WTF::CompactVariant` acts like a `std::variant` with the following differences: - All alternatives must be pointers, smart pointers, have size of 56 bits or fewer, or be specialized for `CompactVariantTraits`. - It can only contain 254 or fewer alternatives. - Has a more limited API, only offering `holds_alternative()` for type checking and `switchOn()` for value access.
Attachments
Sam Weinig
Comment 1 2024-12-23 06:38:41 PST
EWS
Comment 2 2024-12-24 07:30:14 PST
Committed 288271@main (dc904eb4098b): <https://commits.webkit.org/288271@main> Reviewed commits have been landed. Closing PR #38334 and removing active labels.
Radar WebKit Bug Importer
Comment 3 2024-12-24 07:31:15 PST
Note You need to log in before you can comment on or make changes to this bug.