| 106 | |
| 107 | |
| 108 | static void close_state (lua_State *L) { |
| 109 | global_State *g = G(L); |
| 110 | luaF_close(L, L->stack); /* close all upvalues for this thread */ |
| 111 | luaC_freeall(L); /* collect all objects */ |
| 112 | lua_assert(g->rootgc == obj2gco(L)); |
| 113 | lua_assert(g->strt.nuse == 0); |
| 114 | luaM_freearray(L, G(L)->strt.hash, G(L)->strt.size, TString *); |
| 115 | luaZ_freebuffer(L, &g->buff); |
| 116 | freestack(L, L); |
| 117 | lua_assert(g->totalbytes == sizeof(LG)); |
| 118 | (*g->frealloc)(g->ud, fromstate(L), state_size(LG), 0); |
| 119 | } |
| 120 | |
| 121 | |
| 122 | lua_State *luaE_newthread (lua_State *L) { |
no test coverage detected