From 35a2fed2d1e0b95a1bfab364707e469863517085 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Thu, 30 Nov 2023 15:51:02 -0300 Subject: Removed deprecated options in 'lua_gc' Options 'setpause' and 'setstepmul' were deprecated in Lua 5.4. --- lapi.c | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) (limited to 'lapi.c') diff --git a/lapi.c b/lapi.c index 2aaa6505..93695144 100644 --- a/lapi.c +++ b/lapi.c @@ -1163,7 +1163,7 @@ LUA_API int lua_gc (lua_State *L, int what, ...) { va_list argp; int res = 0; global_State *g = G(L); - if (g->gcstp & GCSTPGC) /* internal stop? */ + if (g->gcstp & (GCSTPGC | GCSTPCLS)) /* internal stop? */ return -1; /* all options are invalid when stopped */ lua_lock(L); va_start(argp, what); @@ -1174,7 +1174,7 @@ LUA_API int lua_gc (lua_State *L, int what, ...) { } case LUA_GCRESTART: { luaE_setdebt(g, 0); - g->gcstp = 0; /* (bit GCSTPGC must be zero here) */ + g->gcstp = 0; /* (other bits must be zero here) */ break; } case LUA_GCCOLLECT: { @@ -1194,7 +1194,7 @@ LUA_API int lua_gc (lua_State *L, int what, ...) { int todo = va_arg(argp, int); /* work to be done */ int didsomething = 0; lu_byte oldstp = g->gcstp; - g->gcstp = 0; /* allow GC to run (bit GCSTPGC must be zero here) */ + g->gcstp = 0; /* allow GC to run (other bits must be zero here) */ if (todo == 0) todo = 1 << g->gcstepsize; /* standard step size */ while (todo >= g->GCdebt) { /* enough to run a step? */ @@ -1213,18 +1213,6 @@ LUA_API int lua_gc (lua_State *L, int what, ...) { res = 1; /* signal it */ break; } - case LUA_GCSETPAUSE: { - unsigned int data = va_arg(argp, unsigned int); - res = applygcparam(g, gcpause, 100); - setgcparam(g, gcpause, data); - break; - } - case LUA_GCSETSTEPMUL: { - unsigned int data = va_arg(argp, unsigned int); - res = applygcparam(g, gcstepmul, 100); - setgcparam(g, gcstepmul, data); - break; - } case LUA_GCISRUNNING: { res = gcrunning(g); break; -- cgit v1.2.3-55-g6feb