/* Performs a basic incremental step. The debt and step size are converted from bytes to "units of work"; then the function loops running single steps until adding that many units of work or finishing a cycle (pause state). Finally, it sets the debt that controls when next step will be performed.  */
static void incstep(lua_State *L, global_State *g)
/* Performs a basic incremental step. The debt and step size are converted from bytes to "units of work"; then the function loops running single steps until adding that many units of work or finishing a cycle (pause state). Finally, it sets the debt that controls when next step will be performed.  */
static void incstep(lua_State *L, global_State *g)
{
    lu_mem work = singlestep(L);
    debt -= work;
  } while (debt > -stepsize && g->gcstate != GCSpause);
  if (g->gcstate == GCSpause)
    setpause(g);
  else {
    debt = (debt / stepmul) * WORK2MEM;
    luaE_setdebt(g, debt);
  }
}