/*ARGSUSED*/ static void iter_exit(SetIter* iter, const Set* set) { assert(set_empty_iter_is_valid(iter)); SID_del2(iter->empty); free(iter); }
/*ARGSUSED*/ static void iter_exit(SetIter* iter, const Set* set) { assert(set_pseudo_iter_is_valid(iter)); SID_del2(iter->pseudo); free(iter); }
/*ARGSUSED*/ static void set_range_iter_exit(SetIter* iter, const Set* set) { assert(set_range_iter_is_valid(iter)); SID_del2(iter->range); free(iter); }
/* ------------------------------------------------------------------------- * --- set_free * ------------------------------------------------------------------------- */ static void set_empty_free(Set* set) { assert(set_empty_is_valid(set)); set->head.refc--; if (set->head.refc == 0) { SID_del2(set->empty); free(set); } }
/* ------------------------------------------------------------------------- * --- set_free * ------------------------------------------------------------------------- */ static void set_pseudo_free(Set* set) { assert(set_pseudo_is_valid(set)); set->head.refc--; if (set->head.refc == 0) { SID_del2(set->pseudo); free(set); } }
/* ------------------------------------------------------------------------- * --- set_free * ------------------------------------------------------------------------- */ static void set_range_free(Set* set) { assert(set_range_is_valid(set)); set->head.refc--; if (set->head.refc == 0) { SID_del2(set->range); free(set); } }
/* ------------------------------------------------------------------------- * --- set_free * ------------------------------------------------------------------------- */ static void set_prod_free(Set* set) { assert(set_prod_is_valid(set)); set_free(set->prod.set_a); set_free(set->prod.set_b); set->head.refc--; if (set->head.refc == 0) { SID_del2(set->prod); free(set); } }
/*ARGSUSED*/ static void set_prod_iter_exit(SetIter* iter, const Set* set) { int i; assert(set_prod_iter_is_valid(iter)); assert(set_prod_is_valid(set)); SID_del2(iter->prod); set_iter_exit_intern(iter->prod.iter_a, set->prod.set_a); set_iter_exit_intern(iter->prod.iter_b, set->prod.set_b); for(i = 0; i < set->head.dim; i++) if (iter->prod.elem[i] != NULL) elem_free(iter->prod.elem[i]); free(iter->prod.elem); free(iter); }