** Perform a full collection in incremental mode. ** Before running the collection, check 'keepinvariant'; if it is true, ** there may be some objects marked as black, so the collector has ** to sweep all objects to turn them back to white (as white has not ** changed, nothing will be collected). */
| 1708 | ** changed, nothing will be collected). |
| 1709 | */ |
| 1710 | static void fullinc (lua_State *L, global_State *g) { |
| 1711 | if (keepinvariant(g)) /* black objects? */ |
| 1712 | entersweep(L); /* sweep everything to turn them back to white */ |
| 1713 | /* finish any pending sweep phase to start a new cycle */ |
| 1714 | luaC_runtilstate(L, bitmask(GCSpause)); |
| 1715 | luaC_runtilstate(L, bitmask(GCSpropagate)); /* start new cycle */ |
| 1716 | g->gcstate = GCSenteratomic; /* go straight to atomic phase */ |
| 1717 | luaC_runtilstate(L, bitmask(GCScallfin)); /* run up to finalizers */ |
| 1718 | /* estimate must be correct after a full GC cycle */ |
| 1719 | lua_assert(g->GCestimate == gettotalbytes(g)); |
| 1720 | luaC_runtilstate(L, bitmask(GCSpause)); /* finish collection */ |
| 1721 | setpause(g); |
| 1722 | } |
| 1723 | |
| 1724 | |
| 1725 | /* |
no test coverage detected