mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-11-01 07:33:12 +08:00
A limited pass (scr_cyc_collect_set, which freeing a LifetimeRegion runs over the objects the region owned) takes only the candidates in its set. Its walk can still reach other candidates, and one that is referenced from outside is blackened by scan and promoted to the next generation while it keeps its slot in its old generation's buffer. scr_cyc_on_dead finds a candidate's buffer by its generation, so when that object died it removed another buffer's entry and left its own slot pointing at the freed block, which the next pass then read. Such a candidate is no longer promoted: it keeps the generation of the buffer it is in until a pass takes it.