void pp_knowledge_close(pp_knowledge *k) { /* clear the memory taken up by k */ xfree((void*)k->starting_link_lookup_table, ((1+k->nStartingLinks)*sizeof(StartingLinkAndDomain))); free_link_sets(k); free_rules(k); pp_linkset_close(k->set_of_links_starting_bounded_domain); string_set_delete(k->string_set); pp_lexer_close(k->lt); xfree((void*)k, sizeof(pp_knowledge)); }
void pp_knowledge_close(pp_knowledge *k) { if (!k) return; /* clear the memory taken up by k */ free(k->starting_link_lookup_table); free_link_sets(k); free_rules(k); pp_linkset_close(k->set_of_links_starting_bounded_domain); string_set_delete(k->string_set); if (NULL != k->lt) pp_lexer_close(k->lt); free(k); }