more options for controling the GC

This commit is contained in:
Roberto Ierusalimschy
2004-12-06 15:53:42 -02:00
parent 531874f6ce
commit 39a8082f50
7 changed files with 49 additions and 32 deletions

12
lapi.c
View File

@@ -1,5 +1,5 @@
/*
** $Id: lapi.c,v 2.20 2004/11/24 18:55:56 roberto Exp roberto $
** $Id: lapi.c,v 2.21 2004/12/03 20:50:25 roberto Exp roberto $
** Lua API
** See Copyright Notice in lua.h
*/
@@ -867,6 +867,16 @@ LUA_API int lua_gc (lua_State *L, int what, int data) {
luaC_step(L);
break;
}
case LUA_GCSETSTEPMUL: {
res = g->stepmul;
g->stepmul = data;
break;
}
case LUA_GCSETINCMODE: {
res = g->incgc;
g->incgc = data;
break;
}
default: res = -1; /* invalid option */
}
lua_unlock(L);