Skip to content

Commit 4f4d0fd

Browse files
Update syntax.md
1 parent 9914f7f commit 4f4d0fd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/dev/syntax.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ In other words, one needs *one* arc bump when initiating a traversal.
287287
To get rid of allocations, `rowan` takes advantage of `SyntaxNode: !Sync` and uses a thread-local free list of `SyntaxNode`s.
288288
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.
289289

290-
So, while traversal is not exactly incrementing a pointer, it's still pretty cheep: tls + rc bump!
290+
So, while traversal is not exactly incrementing a pointer, it's still pretty cheap: TLS + rc bump!
291291

292292
Traversal also yields (cheap) owned nodes, which improves ergonomics quite a bit.
293293

@@ -309,7 +309,7 @@ struct SyntaxData {
309309
```
310310

311311
This allows using true pointer equality for comparison of identities of `SyntaxNodes`.
312-
rust-analyzer used to have this design as well, but since we've switch to cursors.
312+
rust-analyzer used to have this design as well, but we've since switched to cursors.
313313
The main problem with memoizing the red nodes is that it more than doubles the memory requirements for fully realized syntax trees.
314314
In contrast, cursors generally retain only a path to the root.
315315
C# combats increased memory usage by using weak references.

0 commit comments

Comments
 (0)