diff options
Diffstat (limited to 'ldo.c')
| -rw-r--r-- | ldo.c | 11 |
1 files changed, 7 insertions, 4 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: ldo.c,v 1.96 2000/09/12 13:47:39 roberto Exp roberto $ | 2 | ** $Id: ldo.c,v 1.97 2000/09/25 16:22:42 roberto Exp roberto $ |
| 3 | ** Stack and Call structure of Lua | 3 | ** Stack and Call structure of Lua |
| 4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
| 5 | */ | 5 | */ |
| @@ -33,6 +33,7 @@ | |||
| 33 | 33 | ||
| 34 | void luaD_init (lua_State *L, int stacksize) { | 34 | void luaD_init (lua_State *L, int stacksize) { |
| 35 | L->stack = luaM_newvector(L, stacksize+EXTRA_STACK, TObject); | 35 | L->stack = luaM_newvector(L, stacksize+EXTRA_STACK, TObject); |
| 36 | L->nblocks += stacksize*sizeof(TObject); | ||
| 36 | L->stack_last = L->stack+(stacksize-1); | 37 | L->stack_last = L->stack+(stacksize-1); |
| 37 | L->stacksize = stacksize; | 38 | L->stacksize = stacksize; |
| 38 | L->Cbase = L->top = L->stack; | 39 | L->Cbase = L->top = L->stack; |
| @@ -248,10 +249,12 @@ static int protectedparser (lua_State *L, ZIO *z, int bin) { | |||
| 248 | luaC_checkGC(L); | 249 | luaC_checkGC(L); |
| 249 | old_blocks = L->nblocks; | 250 | old_blocks = L->nblocks; |
| 250 | status = luaD_runprotected(L, f_parser, &p); | 251 | status = luaD_runprotected(L, f_parser, &p); |
| 251 | if (status == LUA_ERRRUN) /* an error occurred: correct error code */ | 252 | if (status == 0) { |
| 253 | /* add new memory to threshould (as it probably will stay) */ | ||
| 254 | L->GCthreshold += (L->nblocks - old_blocks); | ||
| 255 | } | ||
| 256 | else if (status == LUA_ERRRUN) /* an error occurred: correct error code */ | ||
| 252 | status = LUA_ERRSYNTAX; | 257 | status = LUA_ERRSYNTAX; |
| 253 | /* add new memory to threshould (as it probably will stay) */ | ||
| 254 | L->GCthreshold += (L->nblocks - old_blocks); | ||
| 255 | return status; | 258 | return status; |
| 256 | } | 259 | } |
| 257 | 260 | ||
