Revamp of GC parameters

More uniformity when handling GC parameters + avoid divisions by 100
when applying them.
This commit is contained in:
Roberto Ierusalimschy
2022-12-13 11:55:14 -03:00
parent ff106c028c
commit 40565b4a08
6 changed files with 61 additions and 41 deletions

View File

@@ -392,11 +392,11 @@ LUA_API lua_State *lua_newstate (lua_Alloc f, void *ud) {
g->marked = 0;
g->GCdebt = 0;
setivalue(&g->nilvalue, 0); /* to signal that state is not yet built */
setgcparam(g->gcpause, LUAI_GCPAUSE);
setgcparam(g->gcstepmul, LUAI_GCMUL);
setgcparam(g, gcpause, LUAI_GCPAUSE);
setgcparam(g, gcstepmul, LUAI_GCMUL);
g->gcstepsize = LUAI_GCSTEPSIZE;
setgcparam(g->genmajormul, LUAI_GENMAJORMUL);
g->genminormul = LUAI_GENMINORMUL;
setgcparam(g, genmajormul, LUAI_GENMAJORMUL);
setgcparam(g, genminormul, LUAI_GENMINORMUL);
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 */