On top of #41. (Theoretically disjoint, but no size benefit without.)
Uses thin-dst to store GreenNode's kind, text_len, and children all inline in a single allocation, behind a thin pointer.
GreenElement can theoretically be further squished from 2×usize to 1×usize by using alignment bits to tag whether the pointer is a node or a token. That will be proposed in a follow-up PR.
On top of #41. (Theoretically disjoint, but no size benefit without.)
Uses thin-dst to store
GreenNode
'skind
,text_len
, andchildren
all inline in a single allocation, behind a thin pointer.GreenElement
can theoretically be further squished from 2×usize to 1×usize by using alignment bits to tag whether the pointer is a node or a token. That will be proposed in a follow-up PR.r? @matklad
Size comparison
Before: ``` GreenNode 24 GreenToken 8 GreenElement 32 SyntaxNode 8 SyntaxToken 16 SyntaxElement 24 ``` After: ``` GreenNode 8 GreenToken 8 GreenElement 16 SyntaxNode 8 SyntaxToken 16 SyntaxElement 24 ```