summaryrefslogtreecommitdiff
path: root/src/reduce.cc
diff options
context:
space:
mode:
authorAdrian Thurston <thurston@complang.org>2015-12-02 10:50:17 -0500
committerAdrian Thurston <thurston@complang.org>2015-12-02 10:50:17 -0500
commit9bfd3f5510bdf3da7c4084a046cbba5ba7d673fe (patch)
tree268696fcacc5dafc3365357bf2cb4d919a78af14 /src/reduce.cc
parent5e75abcbc165994b9c28fe98c1944da4ce31a7cb (diff)
downloadcolm-9bfd3f5510bdf3da7c4084a046cbba5ba7d673fe.tar.gz
clear the data trees as well as parse trees during reduction
This change brings memory consumption in line with a ragel+kelbt parse for large grammars and inputs.
Diffstat (limited to 'src/reduce.cc')
-rw-r--r--src/reduce.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/reduce.cc b/src/reduce.cc
index 7088e3ed..bf842f76 100644
--- a/src/reduce.cc
+++ b/src/reduce.cc
@@ -584,6 +584,9 @@ void Compiler::writeCommit()
" }\n"
"\n"
" commit_clear_parse_tree( prg, sp, pda_run, lel->child );\n"
+ " commit_clear_kid_list( prg, sp, kid->tree->child );\n"
+ " kid->tree->child = 0;\n"
+ " kid->tree->flags &= ~( AF_LEFT_IGNORE | AF_RIGHT_IGNORE );\n"
" lel->child = 0;\n"
"\n"
" if ( sp != root )\n"