static Code multifileSupervisor(Definition def) { if ( true(def, (P_DYNAMIC|P_MULTIFILE)) ) { if ( true(def, P_DYNAMIC) ) return SUPERVISOR(dynamic); else return SUPERVISOR(multifile); } return NULL; }
static Code undefSupervisor(Definition def) { if ( def->impl.clauses.number_of_clauses == 0 && false(def, PROC_DEFINED) ) return SUPERVISOR(undef); return NULL; }
void freeCodesDefinition(Definition def, int do_linger) { Code codes; if ( (codes=def->codes) != SUPERVISOR(virgin) ) { if ( (codes = def->codes) ) { if ( unlikely(codes[0] == encode(S_CALLWRAPPER)) ) { resetWrappedSupervisor(def); } else { def->codes = SUPERVISOR(virgin); freeSupervisor(def, codes, do_linger); } } else def->codes = SUPERVISOR(virgin); } }
void freeCodesDefinition(Definition def) { Code codes; if ( (codes=def->codes) != SUPERVISOR(virgin) ) { if ( (codes = def->codes) ) { size_t size = (size_t)codes[-1]; def->codes = SUPERVISOR(virgin); if ( size > 0 ) /* 0: built-in, see initSupervisors() */ { GET_LD freeHeap(&codes[-1], (size+1)*sizeof(code)); } } else def->codes = SUPERVISOR(virgin); } }
int createUndefSupervisor(Definition def) { if ( def->number_of_clauses == 0 && false(def, PROC_DEFINED) ) { def->codes = SUPERVISOR(undef); succeed; } fail; }
static Code staticSupervisor(Definition def) { (void)def; return SUPERVISOR(staticp); }