On Mon Jul 17 16:24:10 2023 +0000, Jacek Caban wrote:
We wouldn't unconditionally visit value:
During GC_TRAVERSE, you could traverse weak ref entry both when
traversing the object itself and the weak map. On the first visit, just mark the entry as visited. On the second visit, continue visiting the value. Note that the marking the entry is not the same as "mark alive" in GC. It's purely a marker to know if we should visit the value or leave it for the potential second traversal.
Oh so you meant an additional flag.
That works too, yes, but is there something wrong with my approach? Not that it matters, but there's 1 less flag to worry about, and same amount of checks (check liveness of key or map, instead of the new flag).
Well I will try my version and see what you think first, unless I run into some troubles with it.