no more generational collector (and no more `noinc' mode)
This commit is contained in:
13
lbaselib.c
13
lbaselib.c
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
** $Id: lbaselib.c,v 1.163 2004/12/13 12:15:11 roberto Exp roberto $
|
||||
** $Id: lbaselib.c,v 1.164 2005/01/07 19:53:32 roberto Exp roberto $
|
||||
** Basic library
|
||||
** See Copyright Notice in lua.h
|
||||
*/
|
||||
@@ -182,13 +182,13 @@ static int luaB_gcinfo (lua_State *L) {
|
||||
|
||||
static int luaB_collectgarbage (lua_State *L) {
|
||||
static const char *const opts[] = {"stop", "restart", "collect",
|
||||
"count", "step", "setpace", "setincmode", NULL};
|
||||
"count", "step", "setpace", "setstepmul", NULL};
|
||||
static const int optsnum[] = {LUA_GCSTOP, LUA_GCRESTART, LUA_GCCOLLECT,
|
||||
LUA_GCCOUNT, LUA_GCSTEP, LUA_GCSETPACE, LUA_GCSETINCMODE};
|
||||
LUA_GCCOUNT, LUA_GCSTEP, LUA_GCSETPACE, LUA_GCSETSTEPMUL};
|
||||
int o = luaL_findstring(luaL_optstring(L, 1, "collect"), opts);
|
||||
int ex = luaL_optint(L, 2, 0);
|
||||
lua_Number ex = luaL_optnumber(L, 2, 0);
|
||||
luaL_argcheck(L, o >= 0, 1, "invalid option");
|
||||
lua_pushinteger(L, lua_gc(L, optsnum[o], ex));
|
||||
lua_pushinteger(L, lua_gc(L, optsnum[o], ex * 100));
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -620,9 +620,6 @@ static void base_open (lua_State *L) {
|
||||
/* create register._LOADED to track loaded modules */
|
||||
lua_newtable(L);
|
||||
lua_setfield(L, LUA_REGISTRYINDEX, "_LOADED");
|
||||
/* create register._PRELOAD to allow pre-loaded modules */
|
||||
lua_newtable(L);
|
||||
lua_setfield(L, LUA_REGISTRYINDEX, "_PRELOAD");
|
||||
/* set global _G */
|
||||
lua_pushvalue(L, LUA_GLOBALSINDEX);
|
||||
lua_setglobal(L, "_G");
|
||||
|
||||
Reference in New Issue
Block a user