Merge branch 'master' into nextversion

This commit is contained in:
Roberto Ierusalimschy
2022-12-12 14:08:55 -03:00
2 changed files with 11 additions and 7 deletions

8
lgc.c
View File

@@ -1614,12 +1614,16 @@ static void incstep (lua_State *L, global_State *g) {
}
/*
** performs a basic GC step if collector is running
** Performs a basic GC step if collector is running. (If collector is
** not running, set a reasonable debt to avoid it being called at
** every single check.)
*/
void luaC_step (lua_State *L) {
global_State *g = G(L);
lua_assert(!g->gcemergency);
if (gcrunning(g)) { /* running? */
if (!gcrunning(g)) /* not running? */
luaE_setdebt(g, -2000);
else {
switch (g->gckind) {
case KGC_INC:
incstep(L, g);