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 /lapi.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 'lapi.c')
-rw-r--r-- | lapi.c | 14 |
1 files changed, 0 insertions, 14 deletions
@@ -1186,25 +1186,11 @@ LUA_API int lua_gc (lua_State *L, int what, ...) { | |||
1186 | break; | 1186 | break; |
1187 | } | 1187 | } |
1188 | case LUA_GCGEN: { | 1188 | case LUA_GCGEN: { |
1189 | #if defined(LUA_COMPAT_GCPARAMS) | ||
1190 | int minormul = va_arg(argp, int); | ||
1191 | int minormajor = va_arg(argp, int); | ||
1192 | if (minormul > 0) setgcparam(g, MINORMUL, minormul); | ||
1193 | if (minormajor > 0) setgcparam(g, MINORMAJOR, minormajor); | ||
1194 | #endif | ||
1195 | res = (g->gckind == KGC_INC) ? LUA_GCINC : LUA_GCGEN; | 1189 | res = (g->gckind == KGC_INC) ? LUA_GCINC : LUA_GCGEN; |
1196 | luaC_changemode(L, KGC_GENMINOR); | 1190 | luaC_changemode(L, KGC_GENMINOR); |
1197 | break; | 1191 | break; |
1198 | } | 1192 | } |
1199 | case LUA_GCINC: { | 1193 | case LUA_GCINC: { |
1200 | #if defined(LUA_COMPAT_GCPARAMS) | ||
1201 | int pause = va_arg(argp, int); | ||
1202 | int stepmul = va_arg(argp, int); | ||
1203 | int stepsize = va_arg(argp, int); | ||
1204 | if (pause > 0) setgcparam(g, PAUSE, pause); | ||
1205 | if (stepmul > 0) setgcparam(g, STEPMUL, stepmul); | ||
1206 | if (stepsize > 0) setgcparam(g, STEPSIZE, 1u << stepsize); | ||
1207 | #endif | ||
1208 | res = (g->gckind == KGC_INC) ? LUA_GCINC : LUA_GCGEN; | 1194 | res = (g->gckind == KGC_INC) ? LUA_GCINC : LUA_GCGEN; |
1209 | luaC_changemode(L, KGC_INC); | 1195 | luaC_changemode(L, KGC_INC); |
1210 | break; | 1196 | break; |