From 985a92ec123ff05a361bde6af4602282e3851d77 Mon Sep 17 00:00:00 2001 From: John Clements Date: Sat, 13 Jul 2013 19:12:25 -0700 Subject: [PATCH] comments --- src/libsyntax/ast.rs | 9 +++++++++ 1 file changed, 9 insertions(+) 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>,