/* Performs a full GC cycle; if 'isemergency', set a flag to avoid some operations which could change the interpreter state in some unexpected ways (running finalizers and shrinking some structures). 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).  */
void luaC_fullgc(lua_State *L, int isemergency)
/* Performs a full GC cycle; if 'isemergency', set a flag to avoid some operations which could change the interpreter state in some unexpected ways (running finalizers and shrinking some structures). 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).  */
void luaC_fullgc(lua_State *L, int isemergency)
{
    entersweep(L);
  }
  luaC_runtilstate(L, bitmask(GCSpause));
  luaC_runtilstate(L, ~bitmask(GCSpause));
  luaC_runtilstate(L, bitmask(GCScallfin));
  lua_assert(g->GCestimate == gettotalbytes(g));
  luaC_runtilstate(L, bitmask(GCSpause));
  g->gckind = KGC_NORMAL;
  setpause(g);
}