void script_release(script_ctx_t *ctx) { if(--ctx->ref) return; jsheap_free(&ctx->tmp_heap); SysFreeString(ctx->last_match); heap_free(ctx); }
void release_bytecode(bytecode_t *code) { unsigned i; for(i=0; i < code->bstr_cnt; i++) SysFreeString(code->bstr_pool[i]); jsheap_free(&code->heap); heap_free(code->bstr_pool); heap_free(code->instrs); heap_free(code); }