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

Function luaF_close

Source/Misc/lua/src/lua.c:5924–5940  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5922
5923
5924void luaF_close (lua_State *L, StkId level) {
5925UpVal *uv;
5926global_State *g = G(L);
5927while (L->openupval != NULL && (uv = ngcotouv(L->openupval))->v >= level) {
5928GCObject *o = obj2gco(uv);
5929lua_assert(!isblack(o) && uv->v != &uv->u.value);
5930L->openupval = uv->next; /* remove from `open' list */
5931if (isdead(g, o))
5932luaF_freeupval(L, uv); /* free upvalue */
5933else {
5934unlinkupval(uv);
5935setobj(L, &uv->u.value, uv->v);
5936uv->v = &uv->u.value; /* now current value lives here */
5937luaC_linkupval(L, uv); /* link upvalue into `gcroot' list */
5938}
5939}
5940}
5941
5942
5943Proto *luaF_newproto (lua_State *L) {

Callers 6

resetstackFunction · 0.85
luaD_pcallFunction · 0.85
close_stateFunction · 0.85
luaE_freethreadFunction · 0.85
lua_closeFunction · 0.85
luaV_executeFunction · 0.85

Calls 3

luaF_freeupvalFunction · 0.85
unlinkupvalFunction · 0.85
luaC_linkupvalFunction · 0.85

Tested by

no test coverage detected