| 221 | |
| 222 | |
| 223 | static void close_state (lua_State *L) { |
| 224 | global_State *g = G(L); |
| 225 | luaF_close(L, L->stack); /* close all upvalues for this thread */ |
| 226 | luaC_freeallobjects(L); /* collect all objects */ |
| 227 | if (g->version) /* closing a fully built state? */ |
| 228 | luai_userstateclose(L); |
| 229 | luaM_freearray(L, G(L)->strt.hash, G(L)->strt.size); |
| 230 | luaZ_freebuffer(L, &g->buff); |
| 231 | freestack(L); |
| 232 | lua_assert(gettotalbytes(g) == sizeof(LG)); |
| 233 | (*g->frealloc)(g->ud, fromstate(L), sizeof(LG), 0); /* free main block */ |
| 234 | } |
| 235 | |
| 236 | |
| 237 | LUA_API lua_State *lua_newthread (lua_State *L) { |
no test coverage detected