diff options
Diffstat (limited to '')
-rw-r--r-- | lbaselib.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -199,10 +199,10 @@ static int pushmode (lua_State *L, int oldmode) { | |||
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", "isrunning", "generational", "incremental", | 201 | "count", "step", "isrunning", "generational", "incremental", |
202 | "setparam", NULL}; | 202 | "param", NULL}; |
203 | static const char optsnum[] = {LUA_GCSTOP, LUA_GCRESTART, LUA_GCCOLLECT, | 203 | static const char optsnum[] = {LUA_GCSTOP, LUA_GCRESTART, LUA_GCCOLLECT, |
204 | LUA_GCCOUNT, LUA_GCSTEP, LUA_GCISRUNNING, LUA_GCGEN, LUA_GCINC, | 204 | LUA_GCCOUNT, LUA_GCSTEP, LUA_GCISRUNNING, LUA_GCGEN, LUA_GCINC, |
205 | LUA_GCSETPARAM}; | 205 | LUA_GCPARAM}; |
206 | int o = optsnum[luaL_checkoption(L, 1, "collect", opts)]; | 206 | int o = optsnum[luaL_checkoption(L, 1, "collect", opts)]; |
207 | switch (o) { | 207 | switch (o) { |
208 | case LUA_GCCOUNT: { | 208 | case LUA_GCCOUNT: { |
@@ -231,7 +231,7 @@ static int luaB_collectgarbage (lua_State *L) { | |||
231 | case LUA_GCINC: { | 231 | case LUA_GCINC: { |
232 | return pushmode(L, lua_gc(L, o)); | 232 | return pushmode(L, lua_gc(L, o)); |
233 | } | 233 | } |
234 | case LUA_GCSETPARAM: { | 234 | case LUA_GCPARAM: { |
235 | static const char *const params[] = { | 235 | static const char *const params[] = { |
236 | "minormul", "majorminor", "minormajor", | 236 | "minormul", "majorminor", "minormajor", |
237 | "pause", "stepmul", "stepsize", NULL}; | 237 | "pause", "stepmul", "stepsize", NULL}; |
@@ -239,7 +239,7 @@ static int luaB_collectgarbage (lua_State *L) { | |||
239 | LUA_GCPMINORMUL, LUA_GCPMAJORMINOR, LUA_GCPMINORMAJOR, | 239 | LUA_GCPMINORMUL, LUA_GCPMAJORMINOR, LUA_GCPMINORMAJOR, |
240 | LUA_GCPPAUSE, LUA_GCPSTEPMUL, LUA_GCPSTEPSIZE}; | 240 | LUA_GCPPAUSE, LUA_GCPSTEPMUL, LUA_GCPSTEPSIZE}; |
241 | int p = pnum[luaL_checkoption(L, 2, NULL, params)]; | 241 | int p = pnum[luaL_checkoption(L, 2, NULL, params)]; |
242 | lua_Integer value = luaL_checkinteger(L, 3); | 242 | lua_Integer value = luaL_optinteger(L, 3, -1); |
243 | lua_pushinteger(L, lua_gc(L, o, p, (int)value)); | 243 | lua_pushinteger(L, lua_gc(L, o, p, (int)value)); |
244 | return 1; | 244 | return 1; |
245 | } | 245 | } |