MCPcopy Create free account
hub / github.com/DFHack/dfhack / traverseLclosure

Function traverseLclosure

depends/lua/src/lgc.c:514–527  ·  view source on GitHub ↗

** open upvalues point to values in a thread, so those values should ** be marked when the thread is traversed except in the atomic phase ** (because then the value cannot be changed by the thread and the ** thread may not be traversed again) */

Source from the content-addressed store, hash-verified

512** thread may not be traversed again)
513*/
514static lu_mem traverseLclosure (global_State *g, LClosure *cl) {
515 int i;
516 markobjectN(g, cl->p); /* mark its prototype */
517 for (i = 0; i < cl->nupvalues; i++) { /* mark its upvalues */
518 UpVal *uv = cl->upvals[i];
519 if (uv != NULL) {
520 if (upisopen(uv) && g->gcstate != GCSinsideatomic)
521 uv->u.open.touched = 1; /* can be marked in 'remarkupvals' */
522 else
523 markvalue(g, uv->v);
524 }
525 }
526 return sizeLclosure(cl->nupvalues);
527}
528
529
530static lu_mem traversethread (global_State *g, lua_State *th) {

Callers 1

propagatemarkFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected