MCPcopy Create free account
hub / github.com/defold/defold / luaC_linkupval

Function luaC_linkupval

engine/lua/src/lua/lgc.c:695–710  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

693
694
695void luaC_linkupval (lua_State *L, UpVal *uv) {
696 global_State *g = G(L);
697 GCObject *o = obj2gco(uv);
698 o->gch.next = g->rootgc; /* link upvalue into `rootgc' list */
699 g->rootgc = o;
700 if (isgray(o)) {
701 if (g->gcstate == GCSpropagate) {
702 gray2black(o); /* closed upvalues need barrier */
703 luaC_barrier(L, uv, uv->v);
704 }
705 else { /* sweep phase: sweep it (turning it into white) */
706 makewhite(g, o);
707 lua_assert(g->gcstate != GCSfinalize && g->gcstate != GCSpause);
708 }
709 }
710}
711

Callers 1

luaF_closeFunction · 0.85

Calls 1

GFunction · 0.50

Tested by

no test coverage detected