diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2003-11-19 17:41:57 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2003-11-19 17:41:57 -0200 |
commit | 57b6ed68151c965b48f662828c50264c50e81d73 (patch) | |
tree | 2a3e133e49d9cc52b738fea5383b90c8574caff5 /lgc.h | |
parent | 9b9cdfee8b38feb4b94a3750f7539087d020850c (diff) | |
download | lua-57b6ed68151c965b48f662828c50264c50e81d73.tar.gz lua-57b6ed68151c965b48f662828c50264c50e81d73.tar.bz2 lua-57b6ed68151c965b48f662828c50264c50e81d73.zip |
initial implementation of white/gray/black coloring
Diffstat (limited to 'lgc.h')
-rw-r--r-- | lgc.h | 15 |
1 files changed, 11 insertions, 4 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lgc.h,v 1.22 2003/11/17 19:50:05 roberto Exp roberto $ | 2 | ** $Id: lgc.h,v 1.23 2003/11/18 14:55:11 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 | */ |
@@ -14,10 +14,17 @@ | |||
14 | /* | 14 | /* |
15 | * ** some userful bit tricks | 15 | * ** some userful bit tricks |
16 | * */ | 16 | * */ |
17 | #define resetbits(x,m) ((x) &= cast(lu_byte, ~(m))) | ||
18 | #define setbits(x,m) ((x) |= (m)) | ||
19 | #define testbits(x,m) ((x) & (m)) | ||
17 | #define bitmask(b) (1<<(b)) | 20 | #define bitmask(b) (1<<(b)) |
18 | #define setbit(x,b) ((x) |= bitmask(b)) | 21 | #define bit2mask(b1,b2) (bitmask(b1) | bitmask(b2)) |
19 | #define resetbit(x,b) ((x) &= cast(lu_byte, ~bitmask(b))) | 22 | #define setbit(x,b) setbits(x, bitmask(b)) |
20 | #define testbit(x,b) ((x) & bitmask(b)) | 23 | #define resetbit(x,b) resetbits(x, bitmask(b)) |
24 | #define testbit(x,b) testbits(x, bitmask(b)) | ||
25 | #define set2bits(x,b1,b2) setbits(x, (bit2mask(b1, b2))) | ||
26 | #define reset2bits(x,b1,b2) resetbits(x, (bit2mask(b1, b2))) | ||
27 | #define test2bits(x,b1,b2) testbits(x, (bit2mask(b1, b2))) | ||
21 | 28 | ||
22 | 29 | ||
23 | 30 | ||