aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2010-05-05 15:53:41 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2010-05-05 15:53:41 -0300
commitd77898597ef659907d6698cae319c8be13fcdcde (patch)
treef7d227c27d264e6bccdfa010aafa965e8344e54e
parent237f755dca9a4fd105ec0c1b0b402c7923daceba (diff)
downloadlua-d77898597ef659907d6698cae319c8be13fcdcde.tar.gz
lua-d77898597ef659907d6698cae319c8be13fcdcde.tar.bz2
lua-d77898597ef659907d6698cae319c8be13fcdcde.zip
new function 'luaC_changemode'
-rw-r--r--lapi.c13
-rw-r--r--lgc.h3
2 files changed, 6 insertions, 10 deletions
diff --git a/lapi.c b/lapi.c
index 766878d7..d3c01e27 100644
--- a/lapi.c
+++ b/lapi.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lapi.c,v 2.124 2010/04/20 20:14:50 roberto Exp roberto $ 2** $Id: lapi.c,v 2.125 2010/04/29 17:31:31 roberto Exp roberto $
3** Lua API 3** Lua API
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -69,7 +69,7 @@ static TValue *index2addr (lua_State *L, int idx) {
69 69
70 70
71/* 71/*
72** to be caled by 'lua_checkstack' in protected mode, to grow stack 72** to be called by 'lua_checkstack' in protected mode, to grow stack
73** capturing memory errors 73** capturing memory errors
74*/ 74*/
75static void growstack (lua_State *L, void *ud) { 75static void growstack (lua_State *L, void *ud) {
@@ -966,14 +966,9 @@ LUA_API int lua_gc (lua_State *L, int what, int data) {
966 res = !gcstopped(g); 966 res = !gcstopped(g);
967 break; 967 break;
968 } 968 }
969 case LUA_GCGEN: { /* change collector to generational mode */ 969 case LUA_GCGEN: /* change collector to generational mode */
970 luaC_runtilstate(L, bitmask(GCSpropagate));
971 g->lastmajormem = g->totalbytes;
972 g->gckind = KGC_GEN;
973 break;
974 }
975 case LUA_GCINC: { /* change collector to incremental mode */ 970 case LUA_GCINC: { /* change collector to incremental mode */
976 g->gckind = KGC_NORMAL; 971 luaC_changemode(L, what);
977 break; 972 break;
978 } 973 }
979 default: res = -1; /* invalid option */ 974 default: res = -1; /* invalid option */
diff --git a/lgc.h b/lgc.h
index 75c607b0..f3b97554 100644
--- a/lgc.h
+++ b/lgc.h
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lgc.h,v 2.34 2010/05/03 11:24:30 roberto Exp roberto $ 2** $Id: lgc.h,v 2.35 2010/05/03 17:33:39 roberto Exp roberto $
3** Garbage Collector 3** Garbage Collector
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -134,5 +134,6 @@ LUAI_FUNC void luaC_barrierf (lua_State *L, GCObject *o, GCObject *v);
134LUAI_FUNC void luaC_barrierback (lua_State *L, Table *t); 134LUAI_FUNC void luaC_barrierback (lua_State *L, Table *t);
135LUAI_FUNC void luaC_checkfinalizer (lua_State *L, Udata *u); 135LUAI_FUNC void luaC_checkfinalizer (lua_State *L, Udata *u);
136LUAI_FUNC void luaC_checkupvalcolor (global_State *g, UpVal *uv); 136LUAI_FUNC void luaC_checkupvalcolor (global_State *g, UpVal *uv);
137LUAI_FUNC void luaC_changemode (lua_State *L, int mode);
137 138
138#endif 139#endif