Bug 239680 - Reduce sizeof(CSSNumericType)
Summary: Reduce sizeof(CSSNumericType)
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Alex Christensen
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-04-22 18:03 PDT by Alex Christensen
Modified: 2022-04-22 19:17 PDT (History)
8 users (show)

See Also:


Attachments
Patch (5.00 KB, patch)
2022-04-22 18:03 PDT, Alex Christensen
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Christensen 2022-04-22 18:03:21 PDT
Reduce sizeof(CSSNumericType)
Comment 1 Alex Christensen 2022-04-22 18:03:54 PDT
Created attachment 458191 [details]
Patch
Comment 2 Yusuke Suzuki 2022-04-22 18:07:58 PDT
Comment on attachment 458191 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=458191&action=review

> Source/WebCore/css/typedom/numeric/CSSNumericType.h:39
> +    using BaseTypeStorage = Markable<int, IntegralMarkableTraits<int, std::numeric_limits<int>::min()>>;

We handle INT_MIN as nullopt value, is it correct for these types?
If it is ok, then r=me.
Comment 3 Alex Christensen 2022-04-22 18:13:50 PDT
Comment on attachment 458191 [details]
Patch

In practice most of these values will just be 1 or nullopt, the consequence of hitting INT_MIN are understandable, and the memory wins are worth it in my opinion.
Comment 4 EWS 2022-04-22 19:16:25 PDT
Committed r293278 (249908@main): <https://commits.webkit.org/249908@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 458191 [details].
Comment 5 Radar WebKit Bug Importer 2022-04-22 19:17:14 PDT
<rdar://problem/92201729>