lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Roberto Ierusalimschy wrote:
>I am afraid we missed that. Can you send again?  We are eager for
feedback about GC parameters.

Here is the change we made to luaC_step (we introduced the parameter
"alpha"):

    void luaC_step (lua_State *L) {
      static const int alpha = 8; /* should be a factor > 1, larger =
more aggressive GC, default = 2 */
      global_State *g = G(L);
      l_mem lim = (g->nblocks - (g->GCthreshold - GCSTEPSIZE)) * alpha;
      do {
        lim = singlestep(L, lim);
        if (g->gcstate == GCSfinalize && g->tmudata == NULL)
          break;  /* do not start new collection */
      } while (lim > 0);
      g->GCthreshold = g->nblocks + GCSTEPSIZE - lim/alpha;
      lua_assert((long)g->nblocks + (long)GCSTEPSIZE >= lim/alpha);
    }

Note that this is against 5.1w0.

Cheers,
Jasmin