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 Framework | Assignee: | 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
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 | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Sam Weinig
Pull request: https://github.com/WebKit/WebKit/pull/38334
EWS
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
<rdar://problem/141993688>