lua

A copy of the Lua development repository
Log | Files | Refs | README

commit 32c1764b5d5e092869de4bad7b3182270497d511
parent de97177744cee0c81bf9193ce9601a978636a1ea
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date:   Fri,  7 May 2010 15:43:27 -0300

slightly better definition for 'isgray'

Diffstat:
Mlgc.h | 5+++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lgc.h b/lgc.h @@ -1,5 +1,5 @@ /* -** $Id: lgc.h,v 2.37 2010/05/06 18:17:22 roberto Exp roberto $ +** $Id: lgc.h,v 2.38 2010/05/07 18:08:05 roberto Exp roberto $ ** Garbage Collector ** See Copyright Notice in lua.h */ @@ -86,7 +86,8 @@ #define iswhite(x) testbits((x)->gch.marked, WHITEBITS) #define isblack(x) testbit((x)->gch.marked, BLACKBIT) -#define isgray(x) (!isblack(x) && !iswhite(x)) +#define isgray(x) /* neither white nor black */ \ + (!testbits((x)->gch.marked, WHITEBITS | bitmask(BLACKBIT))) #define isold(x) testbit((x)->gch.marked, OLDBIT)