From 737f119187aca3c8f6743ec6e3cfc04e83723180 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Mon, 20 Dec 2010 16:17:46 -0200 Subject: better control for GC running or stopped --- lstate.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lstate.c') diff --git a/lstate.c b/lstate.c index fee415b6..d13a3ad5 100644 --- a/lstate.c +++ b/lstate.c @@ -1,5 +1,5 @@ /* -** $Id: lstate.c,v 2.86 2010/09/03 14:14:01 roberto Exp roberto $ +** $Id: lstate.c,v 2.87 2010/11/26 14:32:31 roberto Exp roberto $ ** Global State ** See Copyright Notice in lua.h */ @@ -155,6 +155,7 @@ static void f_luaopen (lua_State *L, void *ud) { g->memerrmsg = luaS_newliteral(L, MEMERRMSG); luaS_fix(g->memerrmsg); /* it should never be collected */ g->GCdebt = 0; + g->gcrunning = 1; /* allow gc */ } @@ -241,7 +242,7 @@ LUA_API lua_State *lua_newstate (lua_Alloc f, void *ud) { g->mainthread = L; g->uvhead.u.l.prev = &g->uvhead; g->uvhead.u.l.next = &g->uvhead; - stopgc(g); /* no GC while building state */ + g->gcrunning = 0; /* no GC while building state */ g->lastmajormem = 0; g->strt.size = 0; g->strt.nuse = 0; -- cgit v1.2.3-55-g6feb