]> git.lizzy.rs Git - rust.git/commitdiff
comments
authorJohn Clements <clements@racket-lang.org>
Sun, 14 Jul 2013 02:12:25 +0000 (19:12 -0700)
committerJohn Clements <clements@racket-lang.org>
Fri, 6 Sep 2013 20:35:13 +0000 (13:35 -0700)
src/libsyntax/ast.rs

index 6a4b2ade9315106254cbc3a57460751cb0e5c521..b993f98ec82b16d735941c13b037fd120a5371c8 100644 (file)
@@ -81,6 +81,15 @@ fn ne(&self, other: &Ident) -> bool {
 // 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>,