diff options
| author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2003-12-03 18:03:07 -0200 |
|---|---|---|
| committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2003-12-03 18:03:07 -0200 |
| commit | c6eac44a9420a26a2f8907dcd5266a6aecdb18ea (patch) | |
| tree | acbf11560fe8aee5dddf37ff52b9fcaa6e697ca6 /lgc.h | |
| parent | 8878554b854009066eeccfe7b17e6e019c69758a (diff) | |
| download | lua-c6eac44a9420a26a2f8907dcd5266a6aecdb18ea.tar.gz lua-c6eac44a9420a26a2f8907dcd5266a6aecdb18ea.tar.bz2 lua-c6eac44a9420a26a2f8907dcd5266a6aecdb18ea.zip | |
two different white flags (to distinguish dead elements from new ones)
Diffstat (limited to 'lgc.h')
| -rw-r--r-- | lgc.h | 21 |
1 files changed, 12 insertions, 9 deletions
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | ** $Id: lgc.h,v 1.24 2003/11/19 19:41:57 roberto Exp roberto $ | 2 | ** $Id: lgc.h,v 1.25 2003/12/01 16:33:30 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 | */ |
| @@ -22,8 +22,8 @@ | |||
| 22 | 22 | ||
| 23 | 23 | ||
| 24 | /* | 24 | /* |
| 25 | * ** some userful bit tricks | 25 | ** some userful bit tricks |
| 26 | * */ | 26 | */ |
| 27 | #define resetbits(x,m) ((x) &= cast(lu_byte, ~(m))) | 27 | #define resetbits(x,m) ((x) &= cast(lu_byte, ~(m))) |
| 28 | #define setbits(x,m) ((x) |= (m)) | 28 | #define setbits(x,m) ((x) |= (m)) |
| 29 | #define testbits(x,m) ((x) & (m)) | 29 | #define testbits(x,m) ((x) & (m)) |
| @@ -48,13 +48,16 @@ | |||
| 48 | ** bit 4 - object is fixed (should not be collected) | 48 | ** bit 4 - object is fixed (should not be collected) |
| 49 | */ | 49 | */ |
| 50 | 50 | ||
| 51 | #define GRAYBIT 0 | 51 | #define WHITE0BIT 0 |
| 52 | #define BLACKBIT 1 | 52 | #define WHITE1BIT 1 |
| 53 | #define FINALIZEDBIT 2 | 53 | #define BLACKBIT 2 |
| 54 | #define KEYWEAKBIT 2 | 54 | #define FINALIZEDBIT 3 |
| 55 | #define VALUEWEAKBIT 3 | 55 | #define KEYWEAKBIT 3 |
| 56 | #define FIXEDBIT 4 | 56 | #define VALUEWEAKBIT 4 |
| 57 | #define FIXEDBIT 5 | ||
| 58 | |||
| 57 | 59 | ||
| 60 | #define luaC_white(g) cast(lu_byte, (g)->currentwhite) | ||
| 58 | 61 | ||
| 59 | 62 | ||
| 60 | #define luaC_checkGC(L) { if (G(L)->nblocks >= G(L)->GCthreshold) \ | 63 | #define luaC_checkGC(L) { if (G(L)->nblocks >= G(L)->GCthreshold) \ |
