diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-06-08 16:01:38 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2001-06-08 16:01:38 -0300 |
commit | cbc59592ff684b646b21766a66630df1f7974b25 (patch) | |
tree | 1e28529cda3b8f6baa63285f6a2571767c3ed05e /lgc.c | |
parent | 4905fdd1350bde68cd818b9198f28f5a47c208b0 (diff) | |
download | lua-cbc59592ff684b646b21766a66630df1f7974b25.tar.gz lua-cbc59592ff684b646b21766a66630df1f7974b25.tar.bz2 lua-cbc59592ff684b646b21766a66630df1f7974b25.zip |
new definition for `luaD_call' and `luaD_adjusttop'
Diffstat (limited to 'lgc.c')
-rw-r--r-- | lgc.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lgc.c,v 1.100 2001/06/06 18:00:19 roberto Exp roberto $ | 2 | ** $Id: lgc.c,v 1.101 2001/06/07 15:01:21 roberto Exp roberto $ |
3 | ** Garbage Collector | 3 | ** Garbage Collector |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -338,12 +338,14 @@ static void callgcTM (lua_State *L, const TObject *obj) { | |||
338 | Closure *tm = luaT_gettmbyObj(G(L), obj, TM_GC); | 338 | Closure *tm = luaT_gettmbyObj(G(L), obj, TM_GC); |
339 | if (tm != NULL) { | 339 | if (tm != NULL) { |
340 | int oldah = L->allowhooks; | 340 | int oldah = L->allowhooks; |
341 | StkId top = L->top; | ||
341 | L->allowhooks = 0; /* stop debug hooks during GC tag methods */ | 342 | L->allowhooks = 0; /* stop debug hooks during GC tag methods */ |
342 | luaD_checkstack(L, 2); | 343 | luaD_checkstack(L, 2); |
343 | setclvalue(L->top, tm); | 344 | setclvalue(top, tm); |
344 | setobj(L->top+1, obj); | 345 | setobj(top+1, obj); |
345 | L->top += 2; | 346 | L->top += 2; |
346 | luaD_call(L, L->top-2, 0); | 347 | luaD_call(L, top); |
348 | L->top = top; /* restore top */ | ||
347 | L->allowhooks = oldah; /* restore hooks */ | 349 | L->allowhooks = oldah; /* restore hooks */ |
348 | } | 350 | } |
349 | } | 351 | } |