MCPcopy Create free account
hub / github.com/RomanKubiak/ctrlr / luaC_linkupval

Function luaC_linkupval

Source/Misc/lua/src/lua.c:6697–6712  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6695
6696
6697void luaC_linkupval (lua_State *L, UpVal *uv) {
6698global_State *g = G(L);
6699GCObject *o = obj2gco(uv);
6700o->gch.next = g->rootgc; /* link upvalue into `rootgc' list */
6701g->rootgc = o;
6702if (isgray(o)) {
6703if (g->gcstate == GCSpropagate) {
6704gray2black(o); /* closed upvalues need barrier */
6705luaC_barrier(L, uv, uv->v);
6706}
6707else { /* sweep phase: sweep it (turning it into white) */
6708makewhite(g, o);
6709lua_assert(g->gcstate != GCSfinalize && g->gcstate != GCSpause);
6710}
6711}
6712}
6713
6714/*
6715** $Id: llex.c,v 2.20.1.1 2007/12/27 13:02:25 roberto Exp $

Callers 1

luaF_closeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected