MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / luaC_linkupval

Function luaC_linkupval

deps/lua/src/lgc.c:694–709  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

luaF_closeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected