MCPcopy Create free account
hub / github.com/F-Stack/f-stack / luaF_close

Function luaF_close

freebsd/contrib/openzfs/module/lua/lfunc.c:88–106  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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