[Webkit-unassigned] [Bug 72404] Could save a lot of memory in CharacterData by not always storing a String

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Dec 1 15:58:01 PST 2011


--- Comment #11 from Darin Adler <darin at apple.com>  2011-12-01 15:58:00 PST ---
(In reply to comment #10)
> - Use 1 bit in NodeFlags (currently 2 remaining) to determine whether we have a white space node or not.
> - Use an AlignedBuffer<sizeof(String), WTF_ALIGN_OF(String)>
> - Add an assert that sizeof(String) == sizeof(AtomicString)
> - Based on the flag return a String or AtomicString.

If the two different things you are storing as a union either a String or an AtomicString, then I think you are over-engineering this. The StringImpl object already has a flag in it that tells whether it is in the AtomicString table, and simply constructing an AtomicString then storing it in a String accomplishes what you want to do, making it share a single unique copy.

Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

More information about the webkit-unassigned mailing list