option to return GC to normal (incremental, non generational) mode

This commit is contained in:
Roberto Ierusalimschy
2010-04-02 12:19:19 -03:00
parent e54668b696
commit 11126422d9
3 changed files with 11 additions and 5 deletions

6
lapi.c
View File

@@ -1,5 +1,5 @@
/*
** $Id: lapi.c,v 2.117 2010/03/26 20:58:11 roberto Exp roberto $
** $Id: lapi.c,v 2.118 2010/03/29 17:43:14 roberto Exp roberto $
** Lua API
** See Copyright Notice in lua.h
*/
@@ -952,6 +952,10 @@ LUA_API int lua_gc (lua_State *L, int what, int data) {
g->gckind = KGC_GEN;
break;
}
case LUA_GCINC: { /* change collector to incremental mode */
g->gckind = KGC_NORMAL;
break;
}
default: res = -1; /* invalid option */
}
lua_unlock(L);