diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2010-12-17 10:02:29 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2010-12-17 10:02:29 -0200 |
commit | a40768e5ea2732d1630e589eee82c4328370aa64 (patch) | |
tree | 7f04478e7b0151b3c7018b9215acea37bf2e0ef4 /lgc.h | |
parent | 4a83fe569cc91b45e16ab581c879d76c79a6af86 (diff) | |
download | lua-a40768e5ea2732d1630e589eee82c4328370aa64.tar.gz lua-a40768e5ea2732d1630e589eee82c4328370aa64.tar.bz2 lua-a40768e5ea2732d1630e589eee82c4328370aa64.zip |
new macro 'luaC_condGC' to allow extra code to be run in case
of GC steps
Diffstat (limited to 'lgc.h')
-rw-r--r-- | lgc.h | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lgc.h,v 2.45 2010/11/26 14:32:31 roberto Exp roberto $ | 2 | ** $Id: lgc.h,v 2.46 2010/12/02 19:51:15 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 | */ |
@@ -108,7 +108,9 @@ | |||
108 | #define luaC_white(g) cast(lu_byte, (g)->currentwhite & WHITEBITS) | 108 | #define luaC_white(g) cast(lu_byte, (g)->currentwhite & WHITEBITS) |
109 | 109 | ||
110 | 110 | ||
111 | #define luaC_checkGC(L) {condchangemem(L); if (G(L)->GCdebt > 0) luaC_step(L);} | 111 | #define luaC_condGC(L,c) \ |
112 | {if (G(L)->GCdebt > 0) {c;}; condchangemem(L);} | ||
113 | #define luaC_checkGC(L) luaC_condGC(L, luaC_step(L);) | ||
112 | 114 | ||
113 | 115 | ||
114 | #define luaC_barrier(L,p,v) { if (valiswhite(v) && isblack(obj2gco(p))) \ | 116 | #define luaC_barrier(L,p,v) { if (valiswhite(v) && isblack(obj2gco(p))) \ |