What's the go with the GC these days?

Neia Neutuladh neia at ikeran.org
Tue Jan 8 18:04:26 UTC 2019


On Tue, 08 Jan 2019 09:21:23 -0500, Steven Schveighoffer wrote:
> You copy the memory, then update the references to that memory.

Again, in the case of unions and void[], how do you determine if something 
is a reference to that memory instead of a false pointer?

Moving collectors *have* to be fully precise, and D doesn't allow a fully 
precise collector.

> Even if you pin, if you cast the above from shared to unshared, you then
> have made it so the thread-local pool cannot be scanned independently.

Because the reference to an object in the current thread might be stored 
inside an object allocated by a different thread's GC, and that might have 
happened without a cast. Fixing that would require redesigning shared.

> If we get thread-local pools, and all scans have to be done on all
> thread local pools along with the shared pool, we haven't gained
> anything.

We can shorten the stop-the-world phase to the size of shared memory. If 
you're only sharing a little data and have a decent number of threads, 
this would be a big improvement.


More information about the Digitalmars-d mailing list