more options for controling the GC
This commit is contained in:
10
lbaselib.c
10
lbaselib.c
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
** $Id: lbaselib.c,v 1.159 2004/09/29 21:03:14 roberto Exp roberto $
|
||||
** $Id: lbaselib.c,v 1.160 2004/11/18 19:53:49 roberto Exp roberto $
|
||||
** Basic library
|
||||
** See Copyright Notice in lua.h
|
||||
*/
|
||||
@@ -181,10 +181,10 @@ static int luaB_gcinfo (lua_State *L) {
|
||||
|
||||
|
||||
static int luaB_collectgarbage (lua_State *L) {
|
||||
static const char *const opts[] = {"stop", "restart", "collect", "count",
|
||||
"step", NULL};
|
||||
static const int optsnum[] = {LUA_GCSTOP, LUA_GCRESTART,
|
||||
LUA_GCCOLLECT, LUA_GCCOUNT, LUA_GCSTEP};
|
||||
static const char *const opts[] = {"stop", "restart", "collect",
|
||||
"count", "step", "setstepmul", "setincmode", NULL};
|
||||
static const int optsnum[] = {LUA_GCSTOP, LUA_GCRESTART, LUA_GCCOLLECT,
|
||||
LUA_GCCOUNT, LUA_GCSTEP, LUA_GCSETSTEPMUL, LUA_GCSETINCMODE};
|
||||
int o = luaL_findstring(luaL_optstring(L, 1, "collect"), opts);
|
||||
int ex = luaL_optint(L, 2, 0);
|
||||
luaL_argcheck(L, o >= 0, 1, "invalid option");
|
||||
|
||||
Reference in New Issue
Block a user