From 72d82a296c1430a1d2bb3fac8ed8cbfb97868707 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Fri, 26 May 2017 16:14:29 -0300 Subject: revamping the incremental collector Some simplifications (not counting bytes, couting only slots visited; no more 'gcfinnum'); more GC parameters; using vararg in 'lua_gc' to set parameters in different GC modes --- lgc.h | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'lgc.h') diff --git a/lgc.h b/lgc.h index 6ee0b012..36f361ec 100644 --- a/lgc.h +++ b/lgc.h @@ -1,5 +1,5 @@ /* -** $Id: lgc.h,v 2.96 2017/04/11 18:41:09 roberto Exp roberto $ +** $Id: lgc.h,v 2.97 2017/05/04 13:32:01 roberto Exp roberto $ ** Garbage Collector ** See Copyright Notice in lua.h */ @@ -25,14 +25,6 @@ */ - -/* how much to allocate before next GC step */ -#if !defined(GCSTEPSIZE) -/* ~100 small strings */ -#define GCSTEPSIZE (cast_int(100 * sizeof(TString))) -#endif - - /* ** Possible states of the Garbage Collector */ @@ -125,6 +117,16 @@ check_exp(getage(o) == (f), (o)->marked ^= ((f)^(t))) +/* Default Values for GC parameters */ +#define LUAI_GENMAJORMUL 100 +#define LUAI_GENMINORMUL 5 + +#define LUAI_GCPAUSE 100 /* 100% */ +#define LUAI_GCMUL 10 +/* how much to allocate before next GC step (log2) */ +#define LUAI_GCSTEPSIZE 13 /* 8 KB */ + + /* ** Does one step of collection when debt becomes positive. 'pre'/'pos' ** allows some adjustments to be done only when needed. macro -- cgit v1.2.3-55-g6feb