new function 'luaC_changemode'
This commit is contained in:
13
lapi.c
13
lapi.c
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
** $Id: lapi.c,v 2.124 2010/04/20 20:14:50 roberto Exp roberto $
|
** $Id: lapi.c,v 2.125 2010/04/29 17:31:31 roberto Exp roberto $
|
||||||
** Lua API
|
** Lua API
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
@@ -69,7 +69,7 @@ static TValue *index2addr (lua_State *L, int idx) {
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
** to be caled by 'lua_checkstack' in protected mode, to grow stack
|
** to be called by 'lua_checkstack' in protected mode, to grow stack
|
||||||
** capturing memory errors
|
** capturing memory errors
|
||||||
*/
|
*/
|
||||||
static void growstack (lua_State *L, void *ud) {
|
static void growstack (lua_State *L, void *ud) {
|
||||||
@@ -966,14 +966,9 @@ LUA_API int lua_gc (lua_State *L, int what, int data) {
|
|||||||
res = !gcstopped(g);
|
res = !gcstopped(g);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case LUA_GCGEN: { /* change collector to generational mode */
|
case LUA_GCGEN: /* change collector to generational mode */
|
||||||
luaC_runtilstate(L, bitmask(GCSpropagate));
|
|
||||||
g->lastmajormem = g->totalbytes;
|
|
||||||
g->gckind = KGC_GEN;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case LUA_GCINC: { /* change collector to incremental mode */
|
case LUA_GCINC: { /* change collector to incremental mode */
|
||||||
g->gckind = KGC_NORMAL;
|
luaC_changemode(L, what);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default: res = -1; /* invalid option */
|
default: res = -1; /* invalid option */
|
||||||
|
|||||||
3
lgc.h
3
lgc.h
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
** $Id: lgc.h,v 2.34 2010/05/03 11:24:30 roberto Exp roberto $
|
** $Id: lgc.h,v 2.35 2010/05/03 17:33:39 roberto Exp roberto $
|
||||||
** Garbage Collector
|
** Garbage Collector
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
@@ -134,5 +134,6 @@ LUAI_FUNC void luaC_barrierf (lua_State *L, GCObject *o, GCObject *v);
|
|||||||
LUAI_FUNC void luaC_barrierback (lua_State *L, Table *t);
|
LUAI_FUNC void luaC_barrierback (lua_State *L, Table *t);
|
||||||
LUAI_FUNC void luaC_checkfinalizer (lua_State *L, Udata *u);
|
LUAI_FUNC void luaC_checkfinalizer (lua_State *L, Udata *u);
|
||||||
LUAI_FUNC void luaC_checkupvalcolor (global_State *g, UpVal *uv);
|
LUAI_FUNC void luaC_checkupvalcolor (global_State *g, UpVal *uv);
|
||||||
|
LUAI_FUNC void luaC_changemode (lua_State *L, int mode);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user