More radical ideas about gc and reference counting

Vladimir Panteleev via Digitalmars-d digitalmars-d at puremagic.com
Wed Apr 30 13:31:01 PDT 2014


On Wednesday, 30 April 2014 at 20:21:33 UTC, Andrei Alexandrescu 
wrote:
> Walter and I have had a long chat in which we figured our 
> current offering of abstractions could be improved. Here are 
> some thoughts. There's a lot of work ahead of us on that and I 
> wanted to make sure we're getting full community buy-in and 
> backup.
>
> First off, we're considering eliminating destructor calls from 
> within the GC entirely. It makes for a faster and better GC, 
> but the real reason here is that destructors are 
> philosophically bankrupt in a GC environment. I think there's 
> no need to argue that in this community. The GC never 
> guarantees calling destructors even today, so this decision 
> would be just a point in the definition space (albeit an 
> extreme one).

An extreme one indeed, it would break a lot of my code. Every D 
project I wrote that does networking manages memory using a class 
that resides on the managed heap, but holds the actual wrapped 
data in the unmanaged heap. It has a number of advantages over 
other approaches, and I've posted it to the announce group, but 
the idea didn't seem to catch on.

https://github.com/CyberShadow/ae/blob/master/sys/data.d

I could migrate the concept to use reference counting (it was 
implemented in D1, before reference counting was possible), but 
that's my situation regarding breaking existing code.


More information about the Digitalmars-d mailing list