Reserve SHAREDBIT in GC

This commit is contained in:
hong
2019-05-05 10:36:01 +08:00
committed by 云风
parent bed5f878dc
commit ff9b0538a4

View File

@@ -65,7 +65,7 @@
*/
#define maskcolors (~(bitmask(BLACKBIT) | WHITEBITS))
#define makewhite(g,x) \
(x->marked = cast_byte((x->marked & maskcolors) | luaC_white(g)))
(x->marked = cast_byte((x->marked & maskcolors) | (x->marked & bitmask(SHAREBIT)) | luaC_white(g)))
#define white2gray(x) resetbits(x->marked, WHITEBITS)
#define black2gray(x) resetbit(x->marked, BLACKBIT)
@@ -756,7 +756,7 @@ static GCObject **sweeplist (lua_State *L, GCObject **p, lu_mem count) {
freeobj(L, curr); /* erase 'curr' */
}
else { /* change mark to 'white' */
curr->marked = cast_byte((marked & maskcolors) | white);
curr->marked = cast_byte((marked & maskcolors) | (marked & bitmask(SHAREBIT)) |white);
p = &curr->next; /* go to next element */
}
}