** Call all finalizers of the objects in the given Lua state, and ** then free all objects, except for the main thread. */
| 1401 | ** then free all objects, except for the main thread. |
| 1402 | */ |
| 1403 | void luaC_freeallobjects (lua_State *L) { |
| 1404 | global_State *g = G(L); |
| 1405 | luaC_changemode(L, KGC_INC); |
| 1406 | separatetobefnz(g, 1); /* separate all objects with finalizers */ |
| 1407 | lua_assert(g->finobj == NULL); |
| 1408 | callallpendingfinalizers(L); |
| 1409 | deletelist(L, g->allgc, obj2gco(g->mainthread)); |
| 1410 | deletelist(L, g->finobj, NULL); |
| 1411 | deletelist(L, g->fixedgc, NULL); /* collect fixed objects */ |
| 1412 | lua_assert(g->strt.nuse == 0); |
| 1413 | } |
| 1414 | |
| 1415 | |
| 1416 | static lu_mem atomic (lua_State *L) { |
no test coverage detected