/* By AIS. This relies on free'd pointers being NULLed. The annotations are basically trying to describe how the function operates. */ void nodefree(/*@keep@*/ /*@null@*/ node *np) { if(!np) return; /*@-mustfreeonly@*/ if(np->nextslat) return; /* don't free, has oo data */ if(np==prevslat) return; /* likewise */ /*@=mustfreeonly@*/ /*@-keeptrans@*/ nodefree(np->lval); nodefree(np->rval); free(np); /*@=keeptrans@*/ }
/* external function definitions */ void slpqgiveup(struct slpqent * ep) { if (ep != (struct slpqent *) (0)) { struct slpq *p = ep->sp; int sched = ep->sched; noderemove(ep->np); nodefree(ep->np); bfree((char *) ep); if (sched) slpqwakeup(p, (void (*) ()) (0)); } return; }