static void Mutex_free(CTX ctx, kRawPtr *po) { if(po->rawptr != NULL) { knh_mutex_free(ctx, (kmutex_t *)po->rawptr); po->rawptr = NULL; } }
static void CommonContext_free(CTX, kcontext_t *ctxo) { KFREE(_ctx, ctxo->stack, sizeof(ksfp_t) * ctxo->stacksize); ctxo->stack = NULL; ctxo->esp = NULL; ctxo->stack_uplimit = NULL; ctxo->stacksize = 0; KFREE(_ctx, ctxo->mtdcache, K_MTDCACHE_SIZE * sizeof(knh_mtdcache_t)); KFREE(_ctx, ctxo->tmrcache, K_TMAPCACHE_SIZE * sizeof(knh_tmrcache_t)); ctxo->mtdcache = NULL; ctxo->tmrcache = NULL; knh_mutex_free(_ctxo, ctxo->ctxlock); ctxo->ctxlock = NULL; ctxo->bufa = NULL; if(_ctx->sighandlers != NULL) { KFREE(_ctx, ctx->sighandlers, sizeof(kFunc*) * K_SIGNAL_MAX); ctxo->sighandlers = NULL; } }