first version of control for the generational collector

This commit is contained in:
Roberto Ierusalimschy
2017-04-19 14:02:50 -03:00
parent a45945b6d5
commit c7bdc0e0e8
3 changed files with 21 additions and 7 deletions

6
lapi.c
View File

@@ -1,5 +1,5 @@
/*
** $Id: lapi.c,v 2.261 2017/04/06 13:08:56 roberto Exp roberto $
** $Id: lapi.c,v 2.262 2017/04/11 18:41:09 roberto Exp roberto $
** Lua API
** See Copyright Notice in lua.h
*/
@@ -1098,6 +1098,10 @@ LUA_API int lua_gc (lua_State *L, int what, int data) {
break;
}
case LUA_GCGEN: {
lu_byte aux = data & 0xff;
g->genminormul = (aux == 0) ? 20 : aux;
aux = (data >> 8) & 0xff;
g->genmajormul = (aux == 0) ? 100 : aux;
luaC_changemode(L, KGC_GEN);
break;
}