aboutsummaryrefslogtreecommitdiff
path: root/lstate.c
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2010-12-20 16:17:46 -0200
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2010-12-20 16:17:46 -0200
commit737f119187aca3c8f6743ec6e3cfc04e83723180 (patch)
tree4e1bfb4b2bef35dd2acfe2915ab51481cd9ebc16 /lstate.c
parent8980c630bf40e05dad71ded377e3d0f0a17b076c (diff)
downloadlua-737f119187aca3c8f6743ec6e3cfc04e83723180.tar.gz
lua-737f119187aca3c8f6743ec6e3cfc04e83723180.tar.bz2
lua-737f119187aca3c8f6743ec6e3cfc04e83723180.zip
better control for GC running or stopped
Diffstat (limited to 'lstate.c')
-rw-r--r--lstate.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lstate.c b/lstate.c
index fee415b6..d13a3ad5 100644
--- a/lstate.c
+++ b/lstate.c
@@ -1,5 +1,5 @@
1/* 1/*
2** $Id: lstate.c,v 2.86 2010/09/03 14:14:01 roberto Exp roberto $ 2** $Id: lstate.c,v 2.87 2010/11/26 14:32:31 roberto Exp roberto $
3** Global State 3** Global State
4** See Copyright Notice in lua.h 4** See Copyright Notice in lua.h
5*/ 5*/
@@ -155,6 +155,7 @@ static void f_luaopen (lua_State *L, void *ud) {
155 g->memerrmsg = luaS_newliteral(L, MEMERRMSG); 155 g->memerrmsg = luaS_newliteral(L, MEMERRMSG);
156 luaS_fix(g->memerrmsg); /* it should never be collected */ 156 luaS_fix(g->memerrmsg); /* it should never be collected */
157 g->GCdebt = 0; 157 g->GCdebt = 0;
158 g->gcrunning = 1; /* allow gc */
158} 159}
159 160
160 161
@@ -241,7 +242,7 @@ LUA_API lua_State *lua_newstate (lua_Alloc f, void *ud) {
241 g->mainthread = L; 242 g->mainthread = L;
242 g->uvhead.u.l.prev = &g->uvhead; 243 g->uvhead.u.l.prev = &g->uvhead;
243 g->uvhead.u.l.next = &g->uvhead; 244 g->uvhead.u.l.next = &g->uvhead;
244 stopgc(g); /* no GC while building state */ 245 g->gcrunning = 0; /* no GC while building state */
245 g->lastmajormem = 0; 246 g->lastmajormem = 0;
246 g->strt.size = 0; 247 g->strt.size = 0;
247 g->strt.nuse = 0; 248 g->strt.nuse = 0;