WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
189272
[WTF] Add support for compactly storing multiple optional members in a class
https://bugs.webkit.org/show_bug.cgi?id=189272
Summary
[WTF] Add support for compactly storing multiple optional members in a class
Sam Weinig
Reported
2018-09-04 13:54:03 PDT
Created
attachment 348845
[details]
Proof of concept When you have a class that has multiple std::optional members (and you aren't using CompactOptional from
https://bugs.webkit.org/show_bug.cgi?id=189231
) you end up wasting a lot of space due to the bool each std::optional must contain. I think we can do better. An initial idea, attached as a proof of concept, is to store the bools all together as a bitset and have each optional member be able to access that bitset via some OBJECT_OFFSETOF fun. This requires a bit of macro nastiness and bit more typing per optional value, so I am not 100% sure it's worth it.
Attachments
Proof of concept
(9.08 KB, text/x-csrc)
2018-09-04 13:54 PDT
,
Sam Weinig
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug