| 9018 | |
| 9019 | |
| 9020 | static void close_state (lua_State *L) { |
| 9021 | global_State *g = G(L); |
| 9022 | luaF_close(L, L->stack); /* close all upvalues for this thread */ |
| 9023 | luaC_freeall(L); /* collect all objects */ |
| 9024 | lua_assert(g->rootgc == obj2gco(L)); |
| 9025 | lua_assert(g->strt.nuse == 0); |
| 9026 | luaM_freearray(L, G(L)->strt.hash, G(L)->strt.size, TString *); |
| 9027 | luaZ_freebuffer(L, &g->buff); |
| 9028 | freestack(L, L); |
| 9029 | lua_assert(g->totalbytes == sizeof(LG)); |
| 9030 | (*g->frealloc)(g->ud, fromstate(L), state_size(LG), 0); |
| 9031 | } |
| 9032 | |
| 9033 | |
| 9034 | lua_State *luaE_newthread (lua_State *L) { |
no test coverage detected