MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / luaF_close

Function luaF_close

third-party/lua-5.2.4/src/lfunc.c:89–107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

87
88
89void luaF_close (lua_State *L, StkId level) {
90 UpVal *uv;
91 global_State *g = G(L);
92 while (L->openupval != NULL && (uv = gco2uv(L->openupval))->v >= level) {
93 GCObject *o = obj2gco(uv);
94 lua_assert(!isblack(o) && uv->v != &uv->u.value);
95 L->openupval = uv->next; /* remove from `open' list */
96 if (isdead(g, o))
97 luaF_freeupval(L, uv); /* free upvalue */
98 else {
99 unlinkupval(uv); /* remove upvalue from 'uvhead' list */
100 setobj(L, &uv->u.value, uv->v); /* move value to upvalue slot */
101 uv->v = &uv->u.value; /* now current value lives here */
102 gch(o)->next = g->allgc; /* link upvalue into 'allgc' list */
103 g->allgc = o;
104 luaC_checkupvalcolor(g, uv);
105 }
106 }
107}
108
109
110Proto *luaF_newproto (lua_State *L) {

Callers 5

luaV_executeFunction · 0.70
close_stateFunction · 0.70
luaE_freethreadFunction · 0.70
recoverFunction · 0.70
luaD_pcallFunction · 0.70

Calls 3

luaC_checkupvalcolorFunction · 0.85
luaF_freeupvalFunction · 0.70
unlinkupvalFunction · 0.70

Tested by

no test coverage detected