mirror of
https://github.com/lua/lua
synced 2025-04-09 22:42:52 +03:00
Small correction in 'traverseweakvalue'
After a weak table is traversed in the atomic phase, if it does not have white values ('hasclears') it does not need to be retraversed again. (Comments were correct, but code did not agree with them.)
This commit is contained in:
parent
b5b1995f29
commit
808976bb59
6
lgc.c
6
lgc.c
@ -497,10 +497,10 @@ static void traverseweakvalue (global_State *g, Table *h) {
|
||||
hasclears = 1; /* table will have to be cleared */
|
||||
}
|
||||
}
|
||||
if (g->gcstate == GCSatomic && hasclears)
|
||||
linkgclist(h, g->weak); /* has to be cleared later */
|
||||
else
|
||||
if (g->gcstate == GCSpropagate)
|
||||
linkgclist(h, g->grayagain); /* must retraverse it in atomic phase */
|
||||
else if (hasclears)
|
||||
linkgclist(h, g->weak); /* has to be cleared later */
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user