diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-11-18 09:01:55 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2002-11-18 09:01:55 -0200 |
commit | 43013b39cc28e873e18207e8e7259b6b90fed06b (patch) | |
tree | 3c2a9c520a01086df28c8f0d1ef6d9b5069fa451 /lgc.c | |
parent | 94912d99fcdf61c1fc6dc8897c9d2b0e042e0d63 (diff) | |
download | lua-43013b39cc28e873e18207e8e7259b6b90fed06b.tar.gz lua-43013b39cc28e873e18207e8e7259b6b90fed06b.tar.bz2 lua-43013b39cc28e873e18207e8e7259b6b90fed06b.zip |
new representation for hooks (to allow asynchronous calls to sethook)
Diffstat (limited to 'lgc.c')
-rw-r--r-- | lgc.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lgc.c,v 1.157 2002/11/13 11:49:19 roberto Exp roberto $ | 2 | ** $Id: lgc.c,v 1.158 2002/11/14 11:51:50 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 | */ |
@@ -404,8 +404,8 @@ static void do1gcTM (lua_State *L, Udata *udata) { | |||
404 | 404 | ||
405 | 405 | ||
406 | static void callGCTM (lua_State *L) { | 406 | static void callGCTM (lua_State *L) { |
407 | int oldah = allowhook(L); | 407 | lu_byte oldah = L->allowhook; |
408 | setallowhook(L, 0); /* stop debug hooks during GC tag methods */ | 408 | L->allowhook = 0; /* stop debug hooks during GC tag methods */ |
409 | L->top++; /* reserve space to keep udata while runs its gc method */ | 409 | L->top++; /* reserve space to keep udata while runs its gc method */ |
410 | while (G(L)->tmudata != NULL) { | 410 | while (G(L)->tmudata != NULL) { |
411 | GCObject *o = G(L)->tmudata; | 411 | GCObject *o = G(L)->tmudata; |
@@ -419,7 +419,7 @@ static void callGCTM (lua_State *L) { | |||
419 | do1gcTM(L, udata); | 419 | do1gcTM(L, udata); |
420 | } | 420 | } |
421 | L->top--; | 421 | L->top--; |
422 | setallowhook(L, oldah); /* restore hooks */ | 422 | L->allowhook = oldah; /* restore hooks */ |
423 | } | 423 | } |
424 | 424 | ||
425 | 425 | ||