What's the go with the GC these days?
Steven Schveighoffer
schveiguy at gmail.com
Mon Jan 7 15:21:58 UTC 2019
On 1/5/19 6:12 PM, Neia Neutuladh wrote:
> On Sat, 05 Jan 2019 14:05:19 -0800, Manu wrote:
>> Is progress possible, or is the hard reality that the language is just
>> designed such to be resistant to a quality GC, while the ecosystem sadly
>> tends to rely on it?
>
> Three things about D make it harder to make a good GC for it:
> * unaligned pointers
Unaligned pointers are not scanned, and so this is not a problem. As far
as the GC is concerned, they aren't pointers.
Perhaps you meant interior pointers?
> * unions
Unions and void * (or essentially untyped blocks) are the biggest
problems. But depending on what we want to implement, we may have
solutions for that.
It's difficult to paint with broad brushes here. There are certain
problems that prevent certain solutions. But, for instance, a precise GC
is getting traction as we speak: https://github.com/dlang/druntime/pull/2418
But precise GC is not necessarily better performing. And it's still
"stop-the-world".
I think the biggest improvement for D's GC could be the thread-local
pools (and avoid stop-the-world for those), but since casting shared and
local data around is valid, I don't know how it can be implemented
without language changes.
There are always extra heuristics and algorithmic improvements that
people can analyze in the current GC as well.
-Steve
More information about the Digitalmars-d
mailing list