diff options
Diffstat (limited to 'lgc.h')
-rw-r--r-- | lgc.h | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lgc.h,v 2.90 2015/10/21 18:15:15 roberto Exp roberto $ | 2 | ** $Id: lgc.h,v 2.91 2015/12/21 13:02:14 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 | */ |
@@ -79,7 +79,8 @@ | |||
79 | #define WHITE1BIT 1 /* object is white (type 1) */ | 79 | #define WHITE1BIT 1 /* object is white (type 1) */ |
80 | #define BLACKBIT 2 /* object is black */ | 80 | #define BLACKBIT 2 /* object is black */ |
81 | #define FINALIZEDBIT 3 /* object has been marked for finalization */ | 81 | #define FINALIZEDBIT 3 /* object has been marked for finalization */ |
82 | /* bit 7 is currently used by tests (luaL_checkmemory) */ | 82 | #define OLDBIT 4 /* object is old (gen. mode) */ |
83 | #define TESTGRAYBIT 7 /* used by tests (luaL_checkmemory) */ | ||
83 | 84 | ||
84 | #define WHITEBITS bit2mask(WHITE0BIT, WHITE1BIT) | 85 | #define WHITEBITS bit2mask(WHITE0BIT, WHITE1BIT) |
85 | 86 | ||
@@ -88,11 +89,12 @@ | |||
88 | #define isblack(x) testbit((x)->marked, BLACKBIT) | 89 | #define isblack(x) testbit((x)->marked, BLACKBIT) |
89 | #define isgray(x) /* neither white nor black */ \ | 90 | #define isgray(x) /* neither white nor black */ \ |
90 | (!testbits((x)->marked, WHITEBITS | bitmask(BLACKBIT))) | 91 | (!testbits((x)->marked, WHITEBITS | bitmask(BLACKBIT))) |
92 | #define isold(x) testbit((x)->marked, OLDBIT) | ||
91 | 93 | ||
92 | #define tofinalize(x) testbit((x)->marked, FINALIZEDBIT) | 94 | #define tofinalize(x) testbit((x)->marked, FINALIZEDBIT) |
93 | 95 | ||
94 | #define otherwhite(g) ((g)->currentwhite ^ WHITEBITS) | 96 | #define otherwhite(g) ((g)->currentwhite ^ WHITEBITS) |
95 | #define isdeadm(ow,m) (!(((m) ^ WHITEBITS) & (ow))) | 97 | #define isdeadm(ow,m) ((m) & (ow)) |
96 | #define isdead(g,v) isdeadm(otherwhite(g), (v)->marked) | 98 | #define isdead(g,v) isdeadm(otherwhite(g), (v)->marked) |
97 | 99 | ||
98 | #define changewhite(x) ((x)->marked ^= WHITEBITS) | 100 | #define changewhite(x) ((x)->marked ^= WHITEBITS) |
@@ -142,6 +144,7 @@ LUAI_FUNC void luaC_barrierback_ (lua_State *L, Table *o); | |||
142 | LUAI_FUNC void luaC_upvalbarrier_ (lua_State *L, UpVal *uv); | 144 | LUAI_FUNC void luaC_upvalbarrier_ (lua_State *L, UpVal *uv); |
143 | LUAI_FUNC void luaC_checkfinalizer (lua_State *L, GCObject *o, Table *mt); | 145 | LUAI_FUNC void luaC_checkfinalizer (lua_State *L, GCObject *o, Table *mt); |
144 | LUAI_FUNC void luaC_upvdeccount (lua_State *L, UpVal *uv); | 146 | LUAI_FUNC void luaC_upvdeccount (lua_State *L, UpVal *uv); |
147 | LUAI_FUNC void luaC_changemode (lua_State *L, int newmode); | ||
145 | 148 | ||
146 | 149 | ||
147 | #endif | 150 | #endif |