void ty_teardown() { hst_free(&name_table); hst_for_each(&typedef_table, ty_struct_def_free, NULL); hst_free(&typedef_table); hst_for_each(&enum_table, ty_method_free, NULL); hst_free(&enum_table); hst_for_each(&struct_table, ty_struct_def_free, NULL); hst_free(&struct_table); hst_for_each(&types_table, ty_struct_def_free, NULL); hst_free(&types_table); hst_free(&counted_table); hst_free(&enum_named_table); hst_for_each(&method_table, ty_method_free, NULL); hst_free(&method_table); hst_free(&init_table); hst_free(&generic_ident_table); hst_free(&interface_table); hst_free(&type_named_table); pool_drain(&list_mempool); pool_drain(&type_mempool); indirect_struct_type = NULL; generator_type = NULL; }
void vs_run_callbacks(VarScopeStack *vs, VarScope *targ, int through) { VarScope *scope; for(scope = vs->scope; scope && scope != targ; scope = scope->next) { hst_for_each(&scope->table, vs_callback_callback, NULL); } if(scope && through) { hst_for_each(&scope->table, vs_callback_callback, NULL); } }
void vs_free(VarScopeStack *vs) { pool_drain(&vs->pool); hst_for_each(&vs->modules, &vs_modules_free_each, NULL); hst_free(&vs->modules); }
void vs_pop(VarScopeStack *vs) { VarScope *s = vs->scope; if(!s) return; vs->scope = s->next; if(s->scope == SCOPE) { if(vs->warnunused) hst_for_each(&s->table, vs_run_warnings, NULL); hst_free(&s->table); arr_free(&s->deferments); } free(s); }