mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-25 04:33:05 +00:00
Reserve SHAREDBIT in GC
This commit is contained in:
@@ -65,7 +65,7 @@
|
|||||||
*/
|
*/
|
||||||
#define maskcolors (~(bitmask(BLACKBIT) | WHITEBITS))
|
#define maskcolors (~(bitmask(BLACKBIT) | WHITEBITS))
|
||||||
#define makewhite(g,x) \
|
#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 white2gray(x) resetbits(x->marked, WHITEBITS)
|
||||||
#define black2gray(x) resetbit(x->marked, BLACKBIT)
|
#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' */
|
freeobj(L, curr); /* erase 'curr' */
|
||||||
}
|
}
|
||||||
else { /* change mark to 'white' */
|
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 */
|
p = &curr->next; /* go to next element */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user