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 --- lstate.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'lstate.c') diff --git a/lstate.c b/lstate.c index 3bce076d..5f1c6e48 100644 --- a/lstate.c +++ b/lstate.c @@ -1,5 +1,5 @@ /* -** $Id: lstate.c,v 2.138 2017/04/24 16:59:26 roberto Exp roberto $ +** $Id: lstate.c,v 2.139 2017/05/04 13:32:01 roberto Exp roberto $ ** Global State ** See Copyright Notice in lua.h */ @@ -28,14 +28,6 @@ #include "ltm.h" -#if !defined(LUAI_GCPAUSE) -#define LUAI_GCPAUSE 200 /* 200% */ -#endif - -#if !defined(LUAI_GCMUL) -#define LUAI_GCMUL 200 /* GC runs 'twice the speed' of memory allocation */ -#endif - /* ** a macro to help the creation of a unique random seed when a state is @@ -328,9 +320,9 @@ LUA_API lua_State *lua_newstate (lua_Alloc f, void *ud) { g->twups = NULL; g->totalbytes = sizeof(LG); g->GCdebt = 0; - g->gcfinnum = 0; g->gcpause = LUAI_GCPAUSE; g->gcstepmul = LUAI_GCMUL; + g->gcstepsize = LUAI_GCSTEPSIZE; for (i=0; i < LUA_NUMTAGS; i++) g->mt[i] = NULL; if (luaD_rawrunprotected(L, f_luaopen, NULL) != LUA_OK) { /* memory allocation error: free partial state */ -- cgit v1.2.3-55-g6feb