aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKENTARO OKUDA <[email protected]>2020-05-02 23:55:04 +0100
committerKENTARO OKUDA <[email protected]>2020-05-02 23:55:04 +0100
commit4f4d0fd9ac2e1d4929bc749cbba0b67406302b6a (patch)
tree67337fd57a73d705224ee22734a9e73d24b9a525
parent9914f7fbb2f901c9293a1463707ceffcfdd51ceb (diff)
Update syntax.md
-rw-r--r--docs/dev/syntax.md4
1 files changed, 2 insertions, 2 deletions
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.
287To get rid of allocations, `rowan` takes advantage of `SyntaxNode: !Sync` and uses a thread-local free list of `SyntaxNode`s. 287To get rid of allocations, `rowan` takes advantage of `SyntaxNode: !Sync` and uses a thread-local free list of `SyntaxNode`s.
288In 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. 288In 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.
289 289
290So, while traversal is not exactly incrementing a pointer, it's still pretty cheep: tls + rc bump! 290So, while traversal is not exactly incrementing a pointer, it's still pretty cheap: TLS + rc bump!
291 291
292Traversal also yields (cheap) owned nodes, which improves ergonomics quite a bit. 292Traversal also yields (cheap) owned nodes, which improves ergonomics quite a bit.
293 293
@@ -309,7 +309,7 @@ struct SyntaxData {
309``` 309```
310 310
311This allows using true pointer equality for comparison of identities of `SyntaxNodes`. 311This allows using true pointer equality for comparison of identities of `SyntaxNodes`.
312rust-analyzer used to have this design as well, but since we've switch to cursors. 312rust-analyzer used to have this design as well, but we've since switched to cursors.
313The main problem with memoizing the red nodes is that it more than doubles the memory requirements for fully realized syntax trees. 313The main problem with memoizing the red nodes is that it more than doubles the memory requirements for fully realized syntax trees.
314In contrast, cursors generally retain only a path to the root. 314In contrast, cursors generally retain only a path to the root.
315C# combats increased memory usage by using weak references. 315C# combats increased memory usage by using weak references.