From 3dc5475e239e2da52a380288ae8b293a6b019f81 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Tue, 23 Aug 2011 14:24:34 -0300 Subject: 'nCcalls' should be local to each thread, as each thread may have its own C stack (with LuaThreads or something similar) --- lstate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lstate.c') diff --git a/lstate.c b/lstate.c index 506af472..64b03dc1 100644 --- a/lstate.c +++ b/lstate.c @@ -1,5 +1,5 @@ /* -** $Id: lstate.c,v 2.89 2010/12/20 19:40:07 roberto Exp roberto $ +** $Id: lstate.c,v 2.90 2011/08/09 20:58:29 roberto Exp roberto $ ** Global State ** See Copyright Notice in lua.h */ @@ -171,6 +171,7 @@ static void preinit_state (lua_State *L, global_State *g) { L->ci = NULL; L->stacksize = 0; L->errorJmp = NULL; + L->nCcalls = 0; L->hook = NULL; L->hookmask = 0; L->basehookcount = 0; @@ -237,7 +238,6 @@ LUA_API lua_State *lua_newstate (lua_Alloc f, void *ud) { g->currentwhite = bit2mask(WHITE0BIT, FIXEDBIT); L->marked = luaC_white(g); g->gckind = KGC_NORMAL; - g->nCcalls = 0; preinit_state(L, g); g->frealloc = f; g->ud = ud; -- cgit v1.2.3-55-g6feb