** Call all finalizers of the objects in the given Lua state, and ** then free all objects, except for the main thread. */
| 1501 | ** then free all objects, except for the main thread. |
| 1502 | */ |
| 1503 | void luaC_freeallobjects (lua_State *L) { |
| 1504 | global_State *g = G(L); |
| 1505 | luaC_changemode(L, KGC_INC); |
| 1506 | separatetobefnz(g, 1); /* separate all objects with finalizers */ |
| 1507 | lua_assert(g->finobj == NULL); |
| 1508 | callallpendingfinalizers(L); |
| 1509 | deletelist(L, g->allgc, obj2gco(g->mainthread)); |
| 1510 | deletelist(L, g->finobj, NULL); |
| 1511 | deletelist(L, g->fixedgc, NULL); /* collect fixed objects */ |
| 1512 | lua_assert(g->strt.nuse == 0); |
| 1513 | } |
| 1514 | |
| 1515 | |
| 1516 | static lu_mem atomic (lua_State *L) { |
no test coverage detected