From 93bf6185048256a5df05986460f233ee65136731 Mon Sep 17 00:00:00 2001 From: Roberto Ierusalimschy Date: Tue, 15 Aug 2006 16:59:20 -0300 Subject: BUG: there is only one C stack, so nCcalls must be global --- lstate.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lstate.c') diff --git a/lstate.c b/lstate.c index c9aebcba..30ff3cbd 100644 --- a/lstate.c +++ b/lstate.c @@ -1,5 +1,5 @@ /* -** $Id: lstate.c,v 2.36 2006/05/24 14:15:50 roberto Exp roberto $ +** $Id: lstate.c,v 2.37 2006/07/11 15:53:29 roberto Exp roberto $ ** Global State ** See Copyright Notice in lua.h */ @@ -94,7 +94,7 @@ static void preinit_state (lua_State *L, global_State *g) { resethookcount(L); L->openupval = NULL; L->size_ci = 0; - L->nCcalls = 0; + L->baseCcalls = 0; L->status = 0; L->base_ci = L->ci = NULL; L->savedpc = NULL; @@ -161,6 +161,7 @@ LUA_API lua_State *lua_newstate (lua_Alloc f, void *ud) { g->currentwhite = bit2mask(WHITE0BIT, FIXEDBIT); L->marked = luaC_white(g); g->emergencygc = 0; + g->nCcalls = 0; set2bits(L->marked, FIXEDBIT, SFIXEDBIT); preinit_state(L, g); g->frealloc = f; @@ -214,7 +215,7 @@ LUA_API void lua_close (lua_State *L) { do { /* repeat until no more errors */ L->ci = L->base_ci; L->base = L->top = L->ci->base; - L->nCcalls = 0; + G(L)->nCcalls = 0; } while (luaD_rawrunprotected(L, callallgcTM, NULL) != 0); lua_assert(G(L)->tmudata == NULL); luai_userstateclose(L); -- cgit v1.2.3-55-g6feb