Skip to content

Commit 985a92e

Browse files
committed
comments
1 parent 1a06584 commit 985a92e

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/libsyntax/ast.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,15 @@ impl Ident {
8181
// storage.
8282
pub type SyntaxContext = uint;
8383

84+
// the SCTable contains a table of SyntaxContext_'s. It
85+
// represents a flattened tree structure, to avoid having
86+
// managed pointers everywhere (that caused an ICE).
87+
// the mark_memo and rename_memo fields are side-tables
88+
// that ensure that adding the same mark to the same context
89+
// gives you back the same context as before. This shouldn't
90+
// change the semantics--everything here is immutable--but
91+
// it should cut down on memory use *a lot*; applying a mark
92+
// to a tree containing 50 identifiers would otherwise generate
8493
pub struct SCTable {
8594
table : ~[SyntaxContext_],
8695
mark_memo : HashMap<(SyntaxContext,Mrk),SyntaxContext>,

0 commit comments

Comments
 (0)