lua

A copy of the Lua development repository
Log | Files | Refs | README

commit 5ffcd458f001fce02e5f20a6130e145c6a3caf53
parent 9b01da97e3a8f2df9acbd3b86af50e4040e9d914
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date:   Wed, 23 Oct 2024 17:14:39 -0300

Some changes in default GC parameters

Diffstat:
Mlgc.c | 4+---
Mlgc.h | 10+++++-----
2 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/lgc.c b/lgc.c @@ -1675,7 +1675,7 @@ void luaC_runtilstate (lua_State *L, int state, int fast) { */ static void incstep (lua_State *L, global_State *g) { l_mem stepsize = applygcparam(g, STEPSIZE, 100); - l_mem work2do = applygcparam(g, STEPMUL, stepsize); + l_mem work2do = applygcparam(g, STEPMUL, stepsize / cast_int(sizeof(void*))); l_mem stres; int fast = (work2do == 0); /* special case: do a full collection */ do { /* repeat until enough work */ @@ -1739,8 +1739,6 @@ static void fullinc (lua_State *L, global_State *g) { /* finish any pending sweep phase to start a new cycle */ luaC_runtilstate(L, GCSpause, 1); luaC_runtilstate(L, GCScallfin, 1); /* run up to finalizers */ - /* 'marked' must be correct after a full GC cycle */ - /* lua_assert(g->GCmarked == gettotalobjs(g)); ??? */ luaC_runtilstate(L, GCSpause, 1); /* finish collection */ setpause(g); } diff --git a/lgc.h b/lgc.h @@ -170,7 +170,7 @@ ** Minor collections will shift to major ones after LUAI_MINORMAJOR% ** bytes become old. */ -#define LUAI_MINORMAJOR 100 +#define LUAI_MINORMAJOR 70 /* ** Major collections will shift to minor ones after a collection @@ -182,20 +182,20 @@ ** A young (minor) collection will run after creating LUAI_GENMINORMUL% ** new bytes. */ -#define LUAI_GENMINORMUL 25 +#define LUAI_GENMINORMUL 20 /* incremental */ /* Number of bytes must be LUAI_GCPAUSE% before starting new cycle */ -#define LUAI_GCPAUSE 200 +#define LUAI_GCPAUSE 250 /* ** Step multiplier: The collector handles LUAI_GCMUL% work units for -** each new allocated byte. (Each "work unit" corresponds roughly to +** each new allocated word. (Each "work unit" corresponds roughly to ** sweeping one object or traversing one slot.) */ -#define LUAI_GCMUL 40 +#define LUAI_GCMUL 200 /* How many bytes to allocate before next GC step */ #define LUAI_GCSTEPSIZE (200 * sizeof(Table))