diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2015-08-03 16:40:42 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2015-08-03 16:40:42 -0300 |
commit | 20b9e594419787cceaa04c645e485b13a2a9f4dc (patch) | |
tree | d5a5fec3df72be8df98120d21059d1c4a13dd993 | |
parent | 935d9f7f9042d11acf6b6b9943ddc3812063b875 (diff) | |
download | lua-20b9e594419787cceaa04c645e485b13a2a9f4dc.tar.gz lua-20b9e594419787cceaa04c645e485b13a2a9f4dc.tar.bz2 lua-20b9e594419787cceaa04c645e485b13a2a9f4dc.zip |
barrier macros rewritten as expressions
-rw-r--r-- | lgc.h | 26 |
1 files changed, 13 insertions, 13 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lgc.h,v 2.85 2014/07/19 15:14:46 roberto Exp roberto $ | 2 | ** $Id: lgc.h,v 2.86 2014/10/25 11:50:46 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 | */ |
@@ -106,21 +106,21 @@ | |||
106 | #define luaC_checkGC(L) luaC_condGC(L, luaC_step(L);) | 106 | #define luaC_checkGC(L) luaC_condGC(L, luaC_step(L);) |
107 | 107 | ||
108 | 108 | ||
109 | #define luaC_barrier(L,p,v) { \ | 109 | #define luaC_barrier(L,p,v) ( \ |
110 | if (iscollectable(v) && isblack(p) && iswhite(gcvalue(v))) \ | 110 | (iscollectable(v) && isblack(p) && iswhite(gcvalue(v))) ? \ |
111 | luaC_barrier_(L,obj2gco(p),gcvalue(v)); } | 111 | luaC_barrier_(L,obj2gco(p),gcvalue(v)) : cast_void(0)) |
112 | 112 | ||
113 | #define luaC_barrierback(L,p,v) { \ | 113 | #define luaC_barrierback(L,p,v) ( \ |
114 | if (iscollectable(v) && isblack(p) && iswhite(gcvalue(v))) \ | 114 | (iscollectable(v) && isblack(p) && iswhite(gcvalue(v))) ? \ |
115 | luaC_barrierback_(L,p); } | 115 | luaC_barrierback_(L,p) : cast_void(0)) |
116 | 116 | ||
117 | #define luaC_objbarrier(L,p,o) { \ | 117 | #define luaC_objbarrier(L,p,o) ( \ |
118 | if (isblack(p) && iswhite(o)) \ | 118 | (isblack(p) && iswhite(o)) ? \ |
119 | luaC_barrier_(L,obj2gco(p),obj2gco(o)); } | 119 | luaC_barrier_(L,obj2gco(p),obj2gco(o)) : cast_void(0)) |
120 | 120 | ||
121 | #define luaC_upvalbarrier(L,uv) \ | 121 | #define luaC_upvalbarrier(L,uv) ( \ |
122 | { if (iscollectable((uv)->v) && !upisopen(uv)) \ | 122 | (iscollectable((uv)->v) && !upisopen(uv)) ? \ |
123 | luaC_upvalbarrier_(L,uv); } | 123 | luaC_upvalbarrier_(L,uv) : cast_void(0)) |
124 | 124 | ||
125 | LUAI_FUNC void luaC_fix (lua_State *L, GCObject *o); | 125 | LUAI_FUNC void luaC_fix (lua_State *L, GCObject *o); |
126 | LUAI_FUNC void luaC_freeallobjects (lua_State *L); | 126 | LUAI_FUNC void luaC_freeallobjects (lua_State *L); |