diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2005-02-23 14:30:22 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2005-02-23 14:30:22 -0300 |
commit | d55bb795faaa3a632aeb92fd29fc12b796ae7968 (patch) | |
tree | e81b84b41de1264dd078cec37541716ba0ffcf27 /lgc.c | |
parent | d84cc9d2dbf1f44e7126fe3ed9a82eed9757a63a (diff) | |
download | lua-d55bb795faaa3a632aeb92fd29fc12b796ae7968.tar.gz lua-d55bb795faaa3a632aeb92fd29fc12b796ae7968.tar.bz2 lua-d55bb795faaa3a632aeb92fd29fc12b796ae7968.zip |
details
Diffstat (limited to 'lgc.c')
-rw-r--r-- | lgc.c | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lgc.c,v 2.25 2005/02/14 13:19:50 roberto Exp roberto $ | 2 | ** $Id: lgc.c,v 2.26 2005/02/18 12:40:02 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 | */ |
@@ -36,14 +36,13 @@ | |||
36 | ((x)->gch.marked = ((x)->gch.marked & maskmarks) | luaC_white(g)) | 36 | ((x)->gch.marked = ((x)->gch.marked & maskmarks) | luaC_white(g)) |
37 | 37 | ||
38 | #define white2gray(x) reset2bits((x)->gch.marked, WHITE0BIT, WHITE1BIT) | 38 | #define white2gray(x) reset2bits((x)->gch.marked, WHITE0BIT, WHITE1BIT) |
39 | #define gray2black(x) setbit((x)->gch.marked, BLACKBIT) | ||
40 | #define black2gray(x) resetbit((x)->gch.marked, BLACKBIT) | 39 | #define black2gray(x) resetbit((x)->gch.marked, BLACKBIT) |
41 | 40 | ||
42 | #define stringmark(s) reset2bits((s)->tsv.marked, WHITE0BIT, WHITE1BIT) | 41 | #define stringmark(s) reset2bits((s)->tsv.marked, WHITE0BIT, WHITE1BIT) |
43 | 42 | ||
44 | 43 | ||
45 | #define isfinalized(u) testbit((u)->marked, FINALIZEDBIT) | 44 | #define isfinalized(u) testbit((u)->marked, FINALIZEDBIT) |
46 | #define markfinalized(u) setbit((u)->marked, FINALIZEDBIT) | 45 | #define markfinalized(u) l_setbit((u)->marked, FINALIZEDBIT) |
47 | 46 | ||
48 | 47 | ||
49 | #define KEYWEAK bitmask(KEYWEAKBIT) | 48 | #define KEYWEAK bitmask(KEYWEAKBIT) |
@@ -665,9 +664,9 @@ void luaC_barrierf (lua_State *L, GCObject *o, GCObject *v) { | |||
665 | } | 664 | } |
666 | 665 | ||
667 | 666 | ||
668 | void luaC_barrierback (lua_State *L, GCObject *o, GCObject *v) { | 667 | void luaC_barrierback (lua_State *L, GCObject *o) { |
669 | global_State *g = G(L); | 668 | global_State *g = G(L); |
670 | lua_assert(isblack(o) && iswhite(v) && !isdead(g, v) && !isdead(g, o)); | 669 | lua_assert(isblack(o) && !isdead(g, o)); |
671 | lua_assert(g->gcstate != GCSfinalize && g->gcstate != GCSpause); | 670 | lua_assert(g->gcstate != GCSfinalize && g->gcstate != GCSpause); |
672 | black2gray(o); /* make table gray (again) */ | 671 | black2gray(o); /* make table gray (again) */ |
673 | gco2h(o)->gclist = g->grayagain; | 672 | gco2h(o)->gclist = g->grayagain; |