static void deleteTree( pwr_tStatus *sts, ptree_sTable *tp) { ptree_sAlloc *ap; pool_tRef ar; pool_tRef far; if (tp == NULL) return; for ( ar = tp->g->firstAlloc; ar != pool_cNRef;) { far = ar; ap = pool_Address( sts, tp->php, ar); ar = ap->next; pool_FreeReference( sts, tp->php, far); } }
static void deleteClient ( sub_sClient *cp ) { pwr_tStatus sts; gdb_sNode *np; gdb_AssumeLocked; cancelTimeoutWatch(cp); subc_RemoveFromMessage(cp); hash_Remove(&sts, gdbroot->subc_ht, cp); if (EVEN(sts)) errh_Bugcheck(sts, "remove client from hash table"); np = hash_Search(&sts, gdbroot->nid_ht, &cp->nid); if (np == NULL) errh_Bugcheck(sts, "node not found"); pool_Qremove(&sts, gdbroot->pool, &cp->subc_ll); np->subc_lc--; if (cp->userdata != pool_cNRef) { pool_FreeReference(NULL, gdbroot->rtdb, cp->userdata); } if (cp->cclass != pool_cNRef) { gdb_sCclass *ccp; ccp = pool_Address(NULL, gdbroot->pool, cp->cclass); if (ccp == NULL) errh_Bugcheck(GDH__WEIRD, "cached class address"); cmvolc_UnlockClass(NULL, ccp); cp->cclass = pool_cNRef; } pool_Free(NULL, gdbroot->pool, cp); }