** 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). */
| 1583 | ** changed, nothing will be collected). |
| 1584 | */ |
| 1585 | static void fullinc (lua_State *L, global_State *g) { |
| 1586 | if (keepinvariant(g)) /* black objects? */ |
| 1587 | entersweep(L); /* sweep everything to turn them back to white */ |
| 1588 | /* finish any pending sweep phase to start a new cycle */ |
| 1589 | luaC_runtilstate(L, bitmask(GCSpause)); |
| 1590 | luaC_runtilstate(L, bitmask(GCScallfin)); /* run up to finalizers */ |
| 1591 | /* estimate must be correct after a full GC cycle */ |
| 1592 | lua_assert(g->GCestimate == gettotalbytes(g)); |
| 1593 | luaC_runtilstate(L, bitmask(GCSpause)); /* finish collection */ |
| 1594 | setpause(g); |
| 1595 | } |
| 1596 | |
| 1597 | |
| 1598 | /* |
no test coverage detected