aboutsummaryrefslogtreecommitdiff
path: root/lapi.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2023-11-30 15:51:02 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2023-11-30 15:51:02 -0300
commit35a2fed2d1e0b95a1bfab364707e469863517085 (patch)
treefb268c8e16b3b57a426cf9c84eb536f2958ab5c5 /lapi.c
parent63d68bd657b7386c9c58b4439a100ea0ccbd633e (diff)
downloadlua-35a2fed2d1e0b95a1bfab364707e469863517085.tar.gz
lua-35a2fed2d1e0b95a1bfab364707e469863517085.tar.bz2
lua-35a2fed2d1e0b95a1bfab364707e469863517085.zip
Removed deprecated options in 'lua_gc'
Options 'setpause' and 'setstepmul' were deprecated in Lua 5.4.
Diffstat (limited to 'lapi.c')
-rw-r--r--lapi.c18
1 files changed, 3 insertions, 15 deletions
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, ...) {
1163 va_list argp; 1163 va_list argp;
1164 int res = 0; 1164 int res = 0;
1165 global_State *g = G(L); 1165 global_State *g = G(L);
1166 if (g->gcstp & GCSTPGC) /* internal stop? */ 1166 if (g->gcstp & (GCSTPGC | GCSTPCLS)) /* internal stop? */
1167 return -1; /* all options are invalid when stopped */ 1167 return -1; /* all options are invalid when stopped */
1168 lua_lock(L); 1168 lua_lock(L);
1169 va_start(argp, what); 1169 va_start(argp, what);
@@ -1174,7 +1174,7 @@ LUA_API int lua_gc (lua_State *L, int what, ...) {
1174 } 1174 }
1175 case LUA_GCRESTART: { 1175 case LUA_GCRESTART: {
1176 luaE_setdebt(g, 0); 1176 luaE_setdebt(g, 0);
1177 g->gcstp = 0; /* (bit GCSTPGC must be zero here) */ 1177 g->gcstp = 0; /* (other bits must be zero here) */
1178 break; 1178 break;
1179 } 1179 }
1180 case LUA_GCCOLLECT: { 1180 case LUA_GCCOLLECT: {
@@ -1194,7 +1194,7 @@ LUA_API int lua_gc (lua_State *L, int what, ...) {
1194 int todo = va_arg(argp, int); /* work to be done */ 1194 int todo = va_arg(argp, int); /* work to be done */
1195 int didsomething = 0; 1195 int didsomething = 0;
1196 lu_byte oldstp = g->gcstp; 1196 lu_byte oldstp = g->gcstp;
1197 g->gcstp = 0; /* allow GC to run (bit GCSTPGC must be zero here) */ 1197 g->gcstp = 0; /* allow GC to run (other bits must be zero here) */
1198 if (todo == 0) 1198 if (todo == 0)
1199 todo = 1 << g->gcstepsize; /* standard step size */ 1199 todo = 1 << g->gcstepsize; /* standard step size */
1200 while (todo >= g->GCdebt) { /* enough to run a step? */ 1200 while (todo >= g->GCdebt) { /* enough to run a step? */
@@ -1213,18 +1213,6 @@ LUA_API int lua_gc (lua_State *L, int what, ...) {
1213 res = 1; /* signal it */ 1213 res = 1; /* signal it */
1214 break; 1214 break;
1215 } 1215 }
1216 case LUA_GCSETPAUSE: {
1217 unsigned int data = va_arg(argp, unsigned int);
1218 res = applygcparam(g, gcpause, 100);
1219 setgcparam(g, gcpause, data);
1220 break;
1221 }
1222 case LUA_GCSETSTEPMUL: {
1223 unsigned int data = va_arg(argp, unsigned int);
1224 res = applygcparam(g, gcstepmul, 100);
1225 setgcparam(g, gcstepmul, data);
1226 break;
1227 }
1228 case LUA_GCISRUNNING: { 1216 case LUA_GCISRUNNING: {
1229 res = gcrunning(g); 1217 res = gcrunning(g);
1230 break; 1218 break;