diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2000-10-02 11:47:43 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2000-10-02 11:47:43 -0300 |
commit | 78bc8e553d4190fc3b90be5b621fc0f3507586ef (patch) | |
tree | 9bd9317e1a56960b944549d44a20b91024574c19 /ldo.c | |
parent | dad808a73a98a23729614b8814728d76b4e5d577 (diff) | |
download | lua-78bc8e553d4190fc3b90be5b621fc0f3507586ef.tar.gz lua-78bc8e553d4190fc3b90be5b621fc0f3507586ef.tar.bz2 lua-78bc8e553d4190fc3b90be5b621fc0f3507586ef.zip |
new API for garbage collector
Diffstat (limited to 'ldo.c')
-rw-r--r-- | ldo.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: ldo.c,v 1.97 2000/09/25 16:22:42 roberto Exp roberto $ | 2 | ** $Id: ldo.c,v 1.98 2000/09/29 12:42:13 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 | */ |
@@ -197,6 +197,7 @@ void luaD_call (lua_State *L, StkId func, int nResults) { | |||
197 | nResults--; | 197 | nResults--; |
198 | } | 198 | } |
199 | L->top = func; | 199 | L->top = func; |
200 | luaC_checkGC(L); | ||
200 | } | 201 | } |
201 | 202 | ||
202 | 203 | ||
@@ -366,12 +367,14 @@ int luaD_runprotected (lua_State *L, void (*f)(lua_State *, void *), void *ud) { | |||
366 | StkId oldCbase = L->Cbase; | 367 | StkId oldCbase = L->Cbase; |
367 | StkId oldtop = L->top; | 368 | StkId oldtop = L->top; |
368 | struct lua_longjmp lj; | 369 | struct lua_longjmp lj; |
370 | int allowhooks = L->allowhooks; | ||
369 | lj.status = 0; | 371 | lj.status = 0; |
370 | lj.previous = L->errorJmp; /* chain new error handler */ | 372 | lj.previous = L->errorJmp; /* chain new error handler */ |
371 | L->errorJmp = &lj; | 373 | L->errorJmp = &lj; |
372 | if (setjmp(lj.b) == 0) | 374 | if (setjmp(lj.b) == 0) |
373 | (*f)(L, ud); | 375 | (*f)(L, ud); |
374 | else { /* an error occurred: restore the state */ | 376 | else { /* an error occurred: restore the state */ |
377 | L->allowhooks = allowhooks; | ||
375 | L->Cbase = oldCbase; | 378 | L->Cbase = oldCbase; |
376 | L->top = oldtop; | 379 | L->top = oldtop; |
377 | restore_stack_limit(L); | 380 | restore_stack_limit(L); |