diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2006-08-15 16:59:20 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2006-08-15 16:59:20 -0300 |
commit | 93bf6185048256a5df05986460f233ee65136731 (patch) | |
tree | d7c86e4c11eb3a834be95bfe901f1a9a89b2d9a8 /lstate.c | |
parent | dfe2f1eeff07b0fc42f6a4255624e704d9c9beb5 (diff) | |
download | lua-93bf6185048256a5df05986460f233ee65136731.tar.gz lua-93bf6185048256a5df05986460f233ee65136731.tar.bz2 lua-93bf6185048256a5df05986460f233ee65136731.zip |
BUG: there is only one C stack, so nCcalls must be global
Diffstat (limited to 'lstate.c')
-rw-r--r-- | lstate.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lstate.c,v 2.36 2006/05/24 14:15:50 roberto Exp roberto $ | 2 | ** $Id: lstate.c,v 2.37 2006/07/11 15:53:29 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 | */ |
@@ -94,7 +94,7 @@ static void preinit_state (lua_State *L, global_State *g) { | |||
94 | resethookcount(L); | 94 | resethookcount(L); |
95 | L->openupval = NULL; | 95 | L->openupval = NULL; |
96 | L->size_ci = 0; | 96 | L->size_ci = 0; |
97 | L->nCcalls = 0; | 97 | L->baseCcalls = 0; |
98 | L->status = 0; | 98 | L->status = 0; |
99 | L->base_ci = L->ci = NULL; | 99 | L->base_ci = L->ci = NULL; |
100 | L->savedpc = NULL; | 100 | L->savedpc = NULL; |
@@ -161,6 +161,7 @@ LUA_API lua_State *lua_newstate (lua_Alloc f, void *ud) { | |||
161 | g->currentwhite = bit2mask(WHITE0BIT, FIXEDBIT); | 161 | g->currentwhite = bit2mask(WHITE0BIT, FIXEDBIT); |
162 | L->marked = luaC_white(g); | 162 | L->marked = luaC_white(g); |
163 | g->emergencygc = 0; | 163 | g->emergencygc = 0; |
164 | g->nCcalls = 0; | ||
164 | set2bits(L->marked, FIXEDBIT, SFIXEDBIT); | 165 | set2bits(L->marked, FIXEDBIT, SFIXEDBIT); |
165 | preinit_state(L, g); | 166 | preinit_state(L, g); |
166 | g->frealloc = f; | 167 | g->frealloc = f; |
@@ -214,7 +215,7 @@ LUA_API void lua_close (lua_State *L) { | |||
214 | do { /* repeat until no more errors */ | 215 | do { /* repeat until no more errors */ |
215 | L->ci = L->base_ci; | 216 | L->ci = L->base_ci; |
216 | L->base = L->top = L->ci->base; | 217 | L->base = L->top = L->ci->base; |
217 | L->nCcalls = 0; | 218 | G(L)->nCcalls = 0; |
218 | } while (luaD_rawrunprotected(L, callallgcTM, NULL) != 0); | 219 | } while (luaD_rawrunprotected(L, callallgcTM, NULL) != 0); |
219 | lua_assert(G(L)->tmudata == NULL); | 220 | lua_assert(G(L)->tmudata == NULL); |
220 | luai_userstateclose(L); | 221 | luai_userstateclose(L); |