bearophile Wrote:

> grauzone:
> 
> > I see two things a dotnet implementation of D could have over native D:
> > - better garbage collector (the D one barely does its job...)
> 
> The dotnet GC is probably better than the current D GC, but I think it's 
> designed for mostly movable objects. Currently most (or all) D objects are 
> pinned (they can't be moved around in memory), so I don't know if the dotnet 
> GC will do much good.
> D needs a GC designed for its peculiar characteristics. And I believe D will 
> also need some extra semantics to allow the creation of such efficient 
> half-movable half-pinned GC (I have explained such ideas one time in the 
> past).
> 
> Bye,
> bearophile

I just finished reading about Bartosz's early entry about the shared qualifier 
and how it could lead to per-thead memory heaps (as only shared allocations 
should use the shared heap). This means the GC can maintain different heaps per 
thread, and perform collection locally without pausing the world, and the 
entire heap can just be trashed when the thread exits.

I think it could be much more efficient than a moving GC (as maintaining 
different shared heaps and moving memory between them is a slow process). I am 
really tempted to modify my custom GC to do just that heh.

Reply via email to