aboutsummaryrefslogtreecommitdiff
path: root/lbaselib.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2005-01-14 12:19:42 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2005-01-14 12:19:42 -0200
commit5be517602e5334573297fe8d421a92eb0184ce86 (patch)
treea3253a42f85b2aff30ed46e840e8e547f6746a94 /lbaselib.c
parentd2bda8046c1061c353f9e787e987772b9f96099b (diff)
downloadlua-5be517602e5334573297fe8d421a92eb0184ce86.tar.gz
lua-5be517602e5334573297fe8d421a92eb0184ce86.tar.bz2
lua-5be517602e5334573297fe8d421a92eb0184ce86.zip
no more generational collector (and no more `noinc' mode)
Diffstat (limited to 'lbaselib.c')
-rw-r--r--lbaselib.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/lbaselib.c b/lbaselib.c
index 042556b9..1d7004b1 100644
--- a/lbaselib.c
+++ b/lbaselib.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lbaselib.c,v 1.163 2004/12/13 12:15:11 roberto Exp roberto $ 2** $Id: lbaselib.c,v 1.164 2005/01/07 19:53:32 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*/
@@ -182,13 +182,13 @@ static int luaB_gcinfo (lua_State *L) {
182 182
183static int luaB_collectgarbage (lua_State *L) { 183static int luaB_collectgarbage (lua_State *L) {
184 static const char *const opts[] = {"stop", "restart", "collect", 184 static const char *const opts[] = {"stop", "restart", "collect",
185 "count", "step", "setpace", "setincmode", NULL}; 185 "count", "step", "setpace", "setstepmul", NULL};
186 static const int optsnum[] = {LUA_GCSTOP, LUA_GCRESTART, LUA_GCCOLLECT, 186 static const int optsnum[] = {LUA_GCSTOP, LUA_GCRESTART, LUA_GCCOLLECT,
187 LUA_GCCOUNT, LUA_GCSTEP, LUA_GCSETPACE, LUA_GCSETINCMODE}; 187 LUA_GCCOUNT, LUA_GCSTEP, LUA_GCSETPACE, LUA_GCSETSTEPMUL};
188 int o = luaL_findstring(luaL_optstring(L, 1, "collect"), opts); 188 int o = luaL_findstring(luaL_optstring(L, 1, "collect"), opts);
189 int ex = luaL_optint(L, 2, 0); 189 lua_Number ex = luaL_optnumber(L, 2, 0);
190 luaL_argcheck(L, o >= 0, 1, "invalid option"); 190 luaL_argcheck(L, o >= 0, 1, "invalid option");
191 lua_pushinteger(L, lua_gc(L, optsnum[o], ex)); 191 lua_pushinteger(L, lua_gc(L, optsnum[o], ex * 100));
192 return 1; 192 return 1;
193} 193}
194 194
@@ -620,9 +620,6 @@ static void base_open (lua_State *L) {
620 /* create register._LOADED to track loaded modules */ 620 /* create register._LOADED to track loaded modules */
621 lua_newtable(L); 621 lua_newtable(L);
622 lua_setfield(L, LUA_REGISTRYINDEX, "_LOADED"); 622 lua_setfield(L, LUA_REGISTRYINDEX, "_LOADED");
623 /* create register._PRELOAD to allow pre-loaded modules */
624 lua_newtable(L);
625 lua_setfield(L, LUA_REGISTRYINDEX, "_PRELOAD");
626 /* set global _G */ 623 /* set global _G */
627 lua_pushvalue(L, LUA_GLOBALSINDEX); 624 lua_pushvalue(L, LUA_GLOBALSINDEX);
628 lua_setglobal(L, "_G"); 625 lua_setglobal(L, "_G");