New option "setparms" for 'collectgarbage'

The generational mode also uses the parameters for the incremental
mode in its major collections, so it should be easy to change those
parameters without having to change the GC mode.
This commit is contained in:
Roberto Ierusalimschy
2023-12-22 14:48:07 -03:00
parent ad0ea7813b
commit e2cc179454
13 changed files with 163 additions and 78 deletions

2
lua.c
View File

@@ -646,7 +646,7 @@ static int pmain (lua_State *L) {
luai_openlibs(L); /* open standard libraries */
createargtable(L, argv, argc, script); /* create table 'arg' */
lua_gc(L, LUA_GCRESTART); /* start GC... */
lua_gc(L, LUA_GCGEN, -1, -1, -1); /* ...in generational mode */
lua_gc(L, LUA_GCGEN, 0, 0); /* ...in generational mode */
if (!(args & has_E)) { /* no option '-E'? */
if (handle_luainit(L) != LUA_OK) /* run LUA_INIT */
return 0; /* error running LUA_INIT */