| 981 | |
| 982 | |
| 983 | void luaC_freeallobjects (lua_State *L) { |
| 984 | global_State *g = G(L); |
| 985 | int i; |
| 986 | separatetobefnz(L, 1); /* separate all objects with finalizers */ |
| 987 | lua_assert(g->finobj == NULL); |
| 988 | callallpendingfinalizers(L, 0); |
| 989 | g->currentwhite = WHITEBITS; /* this "white" makes all objects look dead */ |
| 990 | g->gckind = KGC_NORMAL; |
| 991 | sweepwholelist(L, &g->finobj); /* finalizers can create objs. in 'finobj' */ |
| 992 | sweepwholelist(L, &g->allgc); |
| 993 | for (i = 0; i < g->strt.size; i++) /* free all string lists */ |
| 994 | sweepwholelist(L, &g->strt.hash[i]); |
| 995 | lua_assert(g->strt.nuse == 0); |
| 996 | } |
| 997 | |
| 998 | |
| 999 | static l_mem atomic (lua_State *L) { |
no test coverage detected