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