Reserve SHAREDBIT in GC
*/
#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 */
}
}
