[Webkit-unassigned] [Bug 189272] New: [WTF] Add support for compactly storing multiple optional members in a class
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Tue Sep 4 13:54:03 PDT 2018
https://bugs.webkit.org/show_bug.cgi?id=189272
Bug ID: 189272
Summary: [WTF] Add support for compactly storing multiple
optional members in a class
Product: WebKit
Version: WebKit Nightly Build
Hardware: Unspecified
OS: Unspecified
Status: NEW
Severity: Normal
Priority: P2
Component: Web Template Framework
Assignee: webkit-unassigned at lists.webkit.org
Reporter: sam at webkit.org
Created attachment 348845
--> https://bugs.webkit.org/attachment.cgi?id=348845&action=review
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.
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20180904/01c36ca1/attachment.html>
More information about the webkit-unassigned
mailing list