** Insert a variable in the list of to-be-closed variables. */
| 166 | ** Insert a variable in the list of to-be-closed variables. |
| 167 | */ |
| 168 | void luaF_newtbcupval (lua_State *L, StkId level) { |
| 169 | lua_assert(level > L->tbclist.p); |
| 170 | if (l_isfalse(s2v(level))) |
| 171 | return; /* false doesn't need to be closed */ |
| 172 | checkclosemth(L, level); /* value must have a close method */ |
| 173 | while (cast_uint(level - L->tbclist.p) > MAXDELTA) { |
| 174 | L->tbclist.p += MAXDELTA; /* create a dummy node at maximum delta */ |
| 175 | L->tbclist.p->tbclist.delta = 0; |
| 176 | } |
| 177 | level->tbclist.delta = cast(unsigned short, level - L->tbclist.p); |
| 178 | L->tbclist.p = level; |
| 179 | } |
| 180 | |
| 181 | |
| 182 | void luaF_unlinkupval (UpVal *uv) { |
no test coverage detected