2 ms·
> Since the whole point of the region is that the GC doesn't scan it, nothing in the region will be able to keep anything outside the region alive. You can tre
by zozbot234 7y ago
> Since the whole point of the region is that the GC doesn't scan it, nothing in the region will be able to keep anything outside the region alive.
You can treat external references as GC roots.
- int_19h 7y agoHow do you know that they exist, if you're not scanning that memory?
- zozbot234 7y agoThe data structure code can take care of this by registering GC roots with the garbage collector (and de-registering them if an external reference changes). It's no different in principle than any other smart pointer.
- tatersolid 7y ago> You can treat external references as GC roots. Which brings you back to doing an expensive scan of the large off-heap data structure you were trying to avoid.