void sym_hash_destroy(void *g) { struct Global *gg = (struct Global *)g; #ifdef _WAVE_HAVE_JUDY JudySLFreeArray(&gg->sym_judy, PJE0); gg->sym_judy = NULL; #else if(gg->sym_hash) { free_2(gg->sym_hash); gg->sym_hash = NULL; } #endif }
static void dealloc_scope(void) { #ifdef _WAVE_HAVE_JUDY PPvoid_t PPValue; if(PJArray) { char Index[65537]; Index[0] = 0; for (PPValue = JudySLFirst (PJArray, (uint8_t *)Index, PJE0); PPValue != (PPvoid_t) NULL; PPValue = JudySLNext (PJArray, (uint8_t *)Index, PJE0)) { free(*(char **)PPValue); } JudySLFreeArray(&PJArray, PJE0); PJArray = NULL; } #else if(comp_name_jrb) { JRB node; char *Index; jrb_traverse(node, comp_name_jrb) { Index = node->key.s; free(Index); Index = node->val.s; free(Index); } jrb_free_tree(comp_name_jrb); comp_name_jrb = NULL; }
/* * decorated module cleanup (if judy active) */ int decorated_module_cleanup(void) { #ifdef _WAVE_HAVE_JUDY if(GLOBALS->sym_tree) { JudySLFreeArray(&GLOBALS->sym_tree, PJE0); } if(GLOBALS->sym_tree_addresses) { int rcValue; Word_t Index = 0; for (rcValue = Judy1First(GLOBALS->sym_tree_addresses, &Index, PJE0); rcValue != 0; rcValue = Judy1Next(GLOBALS->sym_tree_addresses, &Index, PJE0)) { ((struct tree *)Index)->children_in_gui = 0; } Judy1FreeArray(&GLOBALS->sym_tree_addresses, PJE0); } #endif return(1); }