You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, each green node is allocated on the heap, which helps to be incremental. However, the bulk of files are parsed only once, so it should be cool to have a non-incremental mode as well, where the whole tree is allocated in a bump-allocator.
SyntaxNode/GreenNode setup allows us to do just that! We can have a setup like this
SyntaxRoot{green:GreenNode | Vec<GreenData>
}structSyntaxNode{green:*constGreenData}
type GreenNode = Arc<GreenData>;
The details need to be figured out: ideally, green nodes should always be clone, SyntaxNodes should not do any mode checks when getting green node, and there should only be a single "flag" for incremental mode in the root of the tree.
My gut feeling is that we'll need some kind of shared_from_this unsafe setup here, such that we arena-allocate GreenNodeData, store pointers to GreenNodeData in SyntaxNodes, store pointers to GreenNodeData in the children array in GreenNodeData, but, in case of green node, we know that pointer actually is to Arc<GreenNodeData>.
Currently, each green node is allocated on the heap, which helps to be incremental. However, the bulk of files are parsed only once, so it should be cool to have a non-incremental mode as well, where the whole tree is allocated in a bump-allocator.
SyntaxNode/GreenNode setup allows us to do just that! We can have a setup like this
The details need to be figured out: ideally, green nodes should always be clone, SyntaxNodes should not do any mode checks when getting green node, and there should only be a single "flag" for incremental mode in the root of the tree.
My gut feeling is that we'll need some kind of
shared_from_this
unsafe setup here, such that we arena-allocateGreenNodeData
, store pointers toGreenNodeData
in SyntaxNodes, store pointers toGreenNodeData
in the children array inGreenNodeData
, but, in case of green node, we know that pointer actually is toArc<GreenNodeData>
.We should use https://github.com/fitzgen/bumpalo for arena of GreenData
The text was updated successfully, but these errors were encountered: