diff --git a/src/lr0.c b/src/lr0.c index 48ec30c5..a54f1e15 100644 --- a/src/lr0.c +++ b/src/lr0.c @@ -345,7 +345,6 @@ generate_states (void) } /* discard various storage */ - closure_free (); free_storage (); /* Set up STATES. */ diff --git a/src/main.c b/src/main.c index 065540db..7704bef4 100644 --- a/src/main.c +++ b/src/main.c @@ -23,6 +23,7 @@ #include #include +#include #include #include #include @@ -30,7 +31,6 @@ #include /* relocate2 */ #include -#include "closeout.h" #include "complain.h" #include "conflicts.h" #include "derives.h" diff --git a/src/print-graph.c b/src/print-graph.c index a007ab7a..3e3b7230 100644 --- a/src/print-graph.c +++ b/src/print-graph.c @@ -184,10 +184,8 @@ print_graph (void) start_graph (fgraph); /* Output nodes and edges. */ - closure_new (nritems); for (int i = 0; i < nstates; i++) print_state (states[i], fgraph); - closure_free (); finish_graph (fgraph); xfclose (fgraph); diff --git a/src/print-xml.c b/src/print-xml.c index cbaec8c7..29339844 100644 --- a/src/print-xml.c +++ b/src/print-xml.c @@ -517,7 +517,6 @@ print_xml (void) /* print grammar */ print_grammar (out, level + 1); - closure_new (nritems); no_reduce_set = bitset_create (ntokens, BITSET_FIXED); /* print automaton */ @@ -531,7 +530,6 @@ print_xml (void) xml_puts (out, level + 1, ""); bitset_free (no_reduce_set); - closure_free (); xml_puts (out, 0, ""); diff --git a/src/print.c b/src/print.c index 356fd62a..42adb1d7 100644 --- a/src/print.c +++ b/src/print.c @@ -507,17 +507,11 @@ print_results (void) print_terminal_symbols (out); print_nonterminal_symbols (out); - /* If the whole state item sets, not only the kernels, are wanted, - 'closure' will be run, which needs memory allocation/deallocation. */ - if (report_flag & report_itemsets) - closure_new (nritems); /* Storage for print_reductions. */ no_reduce_set = bitset_create (ntokens, BITSET_FIXED); for (state_number i = 0; i < nstates; i++) print_state (out, states[i]); bitset_free (no_reduce_set); - if (report_flag & report_itemsets) - closure_free (); xfclose (out); } diff --git a/src/state.c b/src/state.c index 1b5bb396..18d3da8b 100644 --- a/src/state.c +++ b/src/state.c @@ -19,13 +19,15 @@ along with this program. If not, see . */ #include +#include "state.h" + #include "system.h" #include +#include "closure.h" #include "complain.h" #include "gram.h" -#include "state.h" #include "print-xml.h" @@ -443,6 +445,7 @@ state **states = NULL; void states_free (void) { + closure_free (); for (state_number i = 0; i < nstates; ++i) state_free (states[i]); free (states);