diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2023-11-30 15:51:02 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2023-11-30 15:51:02 -0300 |
commit | 35a2fed2d1e0b95a1bfab364707e469863517085 (patch) | |
tree | fb268c8e16b3b57a426cf9c84eb536f2958ab5c5 /lbaselib.c | |
parent | 63d68bd657b7386c9c58b4439a100ea0ccbd633e (diff) | |
download | lua-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 'lbaselib.c')
-rw-r--r-- | lbaselib.c | 14 |
1 files changed, 2 insertions, 12 deletions
@@ -198,11 +198,9 @@ static int pushmode (lua_State *L, int oldmode) { | |||
198 | 198 | ||
199 | static int luaB_collectgarbage (lua_State *L) { | 199 | static int luaB_collectgarbage (lua_State *L) { |
200 | static const char *const opts[] = {"stop", "restart", "collect", | 200 | static const char *const opts[] = {"stop", "restart", "collect", |
201 | "count", "step", "setpause", "setstepmul", | 201 | "count", "step", "isrunning", "generational", "incremental", NULL}; |
202 | "isrunning", "generational", "incremental", NULL}; | ||
203 | static const int optsnum[] = {LUA_GCSTOP, LUA_GCRESTART, LUA_GCCOLLECT, | 202 | static const int optsnum[] = {LUA_GCSTOP, LUA_GCRESTART, LUA_GCCOLLECT, |
204 | LUA_GCCOUNT, LUA_GCSTEP, LUA_GCSETPAUSE, LUA_GCSETSTEPMUL, | 203 | LUA_GCCOUNT, LUA_GCSTEP, LUA_GCISRUNNING, LUA_GCGEN, LUA_GCINC}; |
205 | LUA_GCISRUNNING, LUA_GCGEN, LUA_GCINC}; | ||
206 | int o = optsnum[luaL_checkoption(L, 1, "collect", opts)]; | 204 | int o = optsnum[luaL_checkoption(L, 1, "collect", opts)]; |
207 | switch (o) { | 205 | switch (o) { |
208 | case LUA_GCCOUNT: { | 206 | case LUA_GCCOUNT: { |
@@ -219,14 +217,6 @@ static int luaB_collectgarbage (lua_State *L) { | |||
219 | lua_pushboolean(L, res); | 217 | lua_pushboolean(L, res); |
220 | return 1; | 218 | return 1; |
221 | } | 219 | } |
222 | case LUA_GCSETPAUSE: | ||
223 | case LUA_GCSETSTEPMUL: { | ||
224 | int p = (int)luaL_optinteger(L, 2, 0); | ||
225 | int previous = lua_gc(L, o, p); | ||
226 | checkvalres(previous); | ||
227 | lua_pushinteger(L, previous); | ||
228 | return 1; | ||
229 | } | ||
230 | case LUA_GCISRUNNING: { | 220 | case LUA_GCISRUNNING: { |
231 | int res = lua_gc(L, o); | 221 | int res = lua_gc(L, o); |
232 | checkvalres(res); | 222 | checkvalres(res); |