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); }
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 ty_method_free(void *k, void *v, void *d) { hst_free(v); free(v); }
static void vs_modules_free_each(void *key, void *val, void *data) { hst_free(val); free(val); }