void dfsch_tcl_create_command(Tcl_Interp* interp, char* name, dfsch_object_t* proc){ command_context_t* ctx = GC_NEW_UNCOLLECTABLE(command_context_t); ctx->proc = proc; Tcl_CreateCommand(interp, name, command_proc, ctx, GC_free); }
static current_ports_t* current_ports(){ current_ports_t* cp; pthread_once(¤t_ports_key_init, current_ports_key_alloc); cp = pthread_getspecific(current_ports_key); if (DFSCH_UNLIKELY(!cp)){ cp = GC_NEW_UNCOLLECTABLE(current_ports_t); cp->output_port = (dfsch_object_t*)&null_port; cp->input_port = (dfsch_object_t*)&null_port; cp->error_port = (dfsch_object_t*)&null_port; pthread_setspecific(current_ports_key, cp); } return cp; }