diff options
| author | John Clements <clements@racket-lang.org> | 2013-07-13 19:12:25 -0700 |
|---|---|---|
| committer | John Clements <clements@racket-lang.org> | 2013-09-06 13:35:13 -0700 |
| commit | 985a92ec123ff05a361bde6af4602282e3851d77 (patch) | |
| tree | 52f935279a56de2daefe63e001fa4eccf54608b2 /src/libsyntax | |
| parent | 1a065841172a0824046b1f041bdb1134ba820db8 (diff) | |
| download | rust-985a92ec123ff05a361bde6af4602282e3851d77.tar.gz rust-985a92ec123ff05a361bde6af4602282e3851d77.zip | |
comments
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/ast.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index 6a4b2ade931..b993f98ec82 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -81,6 +81,15 @@ impl Ident { // storage. pub type SyntaxContext = uint; +// the SCTable contains a table of SyntaxContext_'s. It +// represents a flattened tree structure, to avoid having +// managed pointers everywhere (that caused an ICE). +// the mark_memo and rename_memo fields are side-tables +// that ensure that adding the same mark to the same context +// gives you back the same context as before. This shouldn't +// change the semantics--everything here is immutable--but +// it should cut down on memory use *a lot*; applying a mark +// to a tree containing 50 identifiers would otherwise generate pub struct SCTable { table : ~[SyntaxContext_], mark_memo : HashMap<(SyntaxContext,Mrk),SyntaxContext>, |
