diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2010-09-03 11:14:01 -0300 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2010-09-03 11:14:01 -0300 |
| commit | 6828f6d42786de735d6696da8cccbb47c8bad347 (patch) | |
| tree | 4645194f43ebcfbd7a00af35278b1e688148760c /lbaselib.c | |
| parent | daa5fe3e31d8ca28a8770df135cbad7fa6fdfa4b (diff) | |
| download | lua-6828f6d42786de735d6696da8cccbb47c8bad347.tar.gz lua-6828f6d42786de735d6696da8cccbb47c8bad347.tar.bz2 lua-6828f6d42786de735d6696da8cccbb47c8bad347.zip | |
new parameter 'majorinc' to control frequency of major collections
in generational mode
Diffstat (limited to 'lbaselib.c')
| -rw-r--r-- | lbaselib.c | 8 |
1 files changed, 4 insertions, 4 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lbaselib.c,v 1.246 2010/07/02 11:38:13 roberto Exp roberto $ | 2 | ** $Id: lbaselib.c,v 1.247 2010/08/23 18:03:11 roberto Exp roberto $ |
| 3 | ** Basic library | 3 | ** Basic library |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -142,11 +142,11 @@ static int luaB_rawset (lua_State *L) { | |||
| 142 | 142 | ||
| 143 | static int luaB_collectgarbage (lua_State *L) { | 143 | static int luaB_collectgarbage (lua_State *L) { |
| 144 | static const char *const opts[] = {"stop", "restart", "collect", | 144 | static const char *const opts[] = {"stop", "restart", "collect", |
| 145 | "count", "step", "setpause", "setstepmul", "isrunning", | 145 | "count", "step", "setpause", "setstepmul", |
| 146 | "gen", "inc", NULL}; | 146 | "setmajorinc", "isrunning", "gen", "inc", NULL}; |
| 147 | static const int optsnum[] = {LUA_GCSTOP, LUA_GCRESTART, LUA_GCCOLLECT, | 147 | static const int optsnum[] = {LUA_GCSTOP, LUA_GCRESTART, LUA_GCCOLLECT, |
| 148 | LUA_GCCOUNT, LUA_GCSTEP, LUA_GCSETPAUSE, LUA_GCSETSTEPMUL, | 148 | LUA_GCCOUNT, LUA_GCSTEP, LUA_GCSETPAUSE, LUA_GCSETSTEPMUL, |
| 149 | LUA_GCISRUNNING, LUA_GCGEN, LUA_GCINC}; | 149 | LUA_GCSETMAJORINC, LUA_GCISRUNNING, LUA_GCGEN, LUA_GCINC}; |
| 150 | int o = optsnum[luaL_checkoption(L, 1, "collect", opts)]; | 150 | int o = optsnum[luaL_checkoption(L, 1, "collect", opts)]; |
| 151 | int ex = luaL_optint(L, 2, 0); | 151 | int ex = luaL_optint(L, 2, 0); |
| 152 | int res = lua_gc(L, o, ex); | 152 | int res = lua_gc(L, o, ex); |
