From 4f4d0fd9ac2e1d4929bc749cbba0b67406302b6a Mon Sep 17 00:00:00 2001 From: KENTARO OKUDA Date: Sat, 2 May 2020 18:55:04 -0400 Subject: Update syntax.md --- docs/dev/syntax.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs') diff --git a/docs/dev/syntax.md b/docs/dev/syntax.md index 9f3c689b2..c2864bbbc 100644 --- a/docs/dev/syntax.md +++ b/docs/dev/syntax.md @@ -287,7 +287,7 @@ In other words, one needs *one* arc bump when initiating a traversal. To get rid of allocations, `rowan` takes advantage of `SyntaxNode: !Sync` and uses a thread-local free list of `SyntaxNode`s. In a typical traversal, you only directly hold a few `SyntaxNode`s at a time (and their ancestors indirectly), so a free list proportional to the depth of the tree removes all allocations in a typical case. -So, while traversal is not exactly incrementing a pointer, it's still pretty cheep: tls + rc bump! +So, while traversal is not exactly incrementing a pointer, it's still pretty cheap: TLS + rc bump! Traversal also yields (cheap) owned nodes, which improves ergonomics quite a bit. @@ -309,7 +309,7 @@ struct SyntaxData { ``` This allows using true pointer equality for comparison of identities of `SyntaxNodes`. -rust-analyzer used to have this design as well, but since we've switch to cursors. +rust-analyzer used to have this design as well, but we've since switched to cursors. The main problem with memoizing the red nodes is that it more than doubles the memory requirements for fully realized syntax trees. In contrast, cursors generally retain only a path to the root. C# combats increased memory usage by using weak references. -- cgit v1.2.3