| 240 | |
| 241 | |
| 242 | static void close_state (lua_State *L) { |
| 243 | global_State *g = G(L); |
| 244 | luaF_close(L, L->stack); /* close all upvalues for this thread */ |
| 245 | luaC_freeallobjects(L); /* collect all objects */ |
| 246 | if (g->version) /* closing a fully built state? */ |
| 247 | luai_userstateclose(L); |
| 248 | luaM_freearray(L, G(L)->strt.hash, G(L)->strt.size); |
| 249 | freestack(L); |
| 250 | lua_assert(gettotalbytes(g) == sizeof(LG)); |
| 251 | (*g->frealloc)(g->ud, fromstate(L), sizeof(LG), 0); /* free main block */ |
| 252 | } |
| 253 | |
| 254 | |
| 255 | LUA_API lua_State *lua_newthread (lua_State *L) { |
no test coverage detected