void free_task (struct task_s *task) { if ( task->refcnt ) return; switch ( task->t ) { case TASK_EVAL: release_expression (task->d.task_eval_v.expr); release_continuation (task->d.task_eval_v.cont); break; case TASK_APP1: release_function (task->d.task_app1_v.erator); release_expression (task->d.task_app1_v.rand); release_continuation (task->d.task_app1_v.cont); break; case TASK_APP: release_function (task->d.task_app_v.erator); release_function (task->d.task_app_v.erand); release_continuation (task->d.task_app_v.cont); break; case TASK_INVOKE: release_continuation (task->d.task_invoke_v.cont); release_function (task->d.task_invoke_v.val); break; default: ; } free (task); }
void free_function (struct function_s *fun) { if ( fun->refcnt ) return; switch ( fun->t ) { case FUNCTION_K1: release_function (fun->d.function_k1_v); break; case FUNCTION_S2: release_function (fun->d.function_s2_v.x); release_function (fun->d.function_s2_v.y); break; case FUNCTION_S1: release_function (fun->d.function_s1_v); break; case FUNCTION_D1: release_expression (fun->d.function_d1_v); break; case FUNCTION_CONT: case FUNCTION_DCONT: release_continuation (fun->d.function_cont_v); break; default: ; } free (fun); }
int main(int argc,char** argv) { //testvas(); gArgc = argc; gArgv = argv; if(argc > 1) f = (frameKernel_t)compile_file(argv[1]); else f = (frameKernel_t)compile_str(); ProcessVideo(); release_function((void*&)f); if(gVideoIn) free(gVideoIn); if(gVideoOut) free(gVideoOut); }
void free_continuation (struct continuation_s *cont) { if ( cont->refcnt ) return; switch ( cont->t ) { case CONTINUATION_APP1: release_expression (cont->d.continuation_app1_v.rand); release_continuation (cont->d.continuation_app1_v.cont); break; case CONTINUATION_APP: release_function (cont->d.continuation_app_v.erator); release_continuation (cont->d.continuation_app_v.cont); break; case CONTINUATION_DEL: release_function (cont->d.continuation_del_v.erand); release_continuation (cont->d.continuation_del_v.cont); break; default: ; } free (cont); }
void free_expression (struct expression_s *expr) { if ( expr->refcnt ) return; switch ( expr->t ) { case EXPRESSION_FUNCTION: release_function (expr->d.expression_function_v); break; case EXPRESSION_APPLICATION: release_expression (expr->d.expression_application_v.rator); release_expression (expr->d.expression_application_v.rand); break; } free (expr); }
void DataBuffer::release() { release_function(); }