draft version of a generational mode for garbage collection. (Not well
tested; no major collections; ...)
This commit is contained in:
8
lapi.c
8
lapi.c
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
** $Id: lapi.c,v 2.113 2010/02/09 11:55:37 roberto Exp roberto $
|
||||
** $Id: lapi.c,v 2.114 2010/03/08 16:55:52 roberto Exp roberto $
|
||||
** Lua API
|
||||
** See Copyright Notice in lua.h
|
||||
*/
|
||||
@@ -928,6 +928,7 @@ LUA_API int lua_gc (lua_State *L, int what, int data) {
|
||||
break;
|
||||
}
|
||||
case LUA_GCRESTART: {
|
||||
g->gckind = KGC_NORMAL;
|
||||
g->GCthreshold = g->totalbytes;
|
||||
break;
|
||||
}
|
||||
@@ -973,6 +974,11 @@ LUA_API int lua_gc (lua_State *L, int what, int data) {
|
||||
res = (g->GCthreshold != MAX_LUMEM);
|
||||
break;
|
||||
}
|
||||
case LUA_GCGEN: { /* change collector to generational mode */
|
||||
luaC_runtilstate(L, bitmask(GCSpropagate));
|
||||
g->gckind = KGC_GEN;
|
||||
break;
|
||||
}
|
||||
default: res = -1; /* invalid option */
|
||||
}
|
||||
lua_unlock(L);
|
||||
|
||||
Reference in New Issue
Block a user