diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2023-12-22 14:57:43 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2023-12-22 14:57:43 -0300 |
commit | e81f586001d767c8de9b760ae2e2c3b5da1542c6 (patch) | |
tree | 26032fb57c824d62a4c1547159d58f5d5c223e96 /lbaselib.c | |
parent | e2cc179454c6aa6cde5f98954bd3783e0d5d53a3 (diff) | |
download | lua-e81f586001d767c8de9b760ae2e2c3b5da1542c6.tar.gz lua-e81f586001d767c8de9b760ae2e2c3b5da1542c6.tar.bz2 lua-e81f586001d767c8de9b760ae2e2c3b5da1542c6.zip |
Removed compatibility option LUA_COMPAT_GCPARAMS
The meaning of different GC parameters changed, so there is point in
supporting old values for them. The new code simply ignores the
parameters when changing the GC mode, so the incompatibility is small.
Diffstat (limited to 'lbaselib.c')
-rw-r--r-- | lbaselib.c | 23 |
1 files changed, 3 insertions, 20 deletions
@@ -213,8 +213,7 @@ static int luaB_collectgarbage (lua_State *L) { | |||
213 | return 1; | 213 | return 1; |
214 | } | 214 | } |
215 | case LUA_GCSTEP: { | 215 | case LUA_GCSTEP: { |
216 | int step = (int)luaL_optinteger(L, 2, 0); | 216 | int res = lua_gc(L, o); |
217 | int res = lua_gc(L, o, step); | ||
218 | checkvalres(res); | 217 | checkvalres(res); |
219 | lua_pushboolean(L, res); | 218 | lua_pushboolean(L, res); |
220 | return 1; | 219 | return 1; |
@@ -226,26 +225,10 @@ static int luaB_collectgarbage (lua_State *L) { | |||
226 | return 1; | 225 | return 1; |
227 | } | 226 | } |
228 | case LUA_GCGEN: { | 227 | case LUA_GCGEN: { |
229 | #if defined(LUA_COMPAT_GCPARAMS) | 228 | return pushmode(L, lua_gc(L, o)); |
230 | int minormul = (int)luaL_optinteger(L, 2, -1); | ||
231 | int majorminor = (int)luaL_optinteger(L, 3, -1); | ||
232 | #else | ||
233 | int minormul = 0; | ||
234 | int majorminor = 0; | ||
235 | #endif | ||
236 | return pushmode(L, lua_gc(L, o, minormul, majorminor)); | ||
237 | } | 229 | } |
238 | case LUA_GCINC: { | 230 | case LUA_GCINC: { |
239 | #if defined(LUA_COMPAT_GCPARAMS) | 231 | return pushmode(L, lua_gc(L, o)); |
240 | int pause = (int)luaL_optinteger(L, 2, -1); | ||
241 | int stepmul = (int)luaL_optinteger(L, 3, -1); | ||
242 | int stepsize = (int)luaL_optinteger(L, 4, -1); | ||
243 | #else | ||
244 | int pause = 0; | ||
245 | int stepmul = 0; | ||
246 | int stepsize = 0; | ||
247 | #endif | ||
248 | return pushmode(L, lua_gc(L, o, pause, stepmul, stepsize)); | ||
249 | } | 232 | } |
250 | case LUA_GCSETPARAM: { | 233 | case LUA_GCSETPARAM: { |
251 | static const char *const params[] = { | 234 | static const char *const params[] = { |