The "no gc" crowd

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Wed Oct 9 11:14:31 PDT 2013


On 10/9/13 6:38 AM, Michel Fortin wrote:
> Walter's idea was to implement ARC for classes implementing IUnknown. So
> if you wanted a ARC'ed class, you implement IUnknown and you're done.
> Problems were on the edges of ARC-controlled pointers and GC-controlled
> ones (which cannot be allowed to be mixed), and also with wanting to use
> the GC to free cycles for these objects (which would make COM AddRef and
> Release unusable when called from non-D code). I think the only way to
> make that work sanely is to create another root object for ref-counted
> classes.

Agreed. This summary reveals the major difficulties involved.

> Another idea was to make *everything* in D ref-counted. ARC simply
> becomes another GC implementation. There can be no confusion between
> what's ref-counted and what isn't (everything is). It's much simpler
> really. But Walter isn't keen on the idea of having to call a function
> at every pointer assignment to keep the reference count up to date (for
> performance reasons), so that idea was rejected. This makes some sense,
> because unlike Objective-C ARC where only Objective-C object pointers
> are ref-counted, in D you'd have to do that with all pointers, and some
> will point to external data that does not need to be ref-counted at all.

I don't think that's on the reject list. Yah, call a function that may 
either be an inline lightweight refcount manipulation, or forward to a 
virtual method etc. It's up to the class.

> It was also pointed out that concurrent GCs require some work to be done
> on pointer assignment (and also when moving a pointer). So it seems to
> me that advances on the GC front are going to be limited without that.
>
> And now, things seems to have stalled again. It's a little disappointing.

I don't think we're stalled.


Andrei



More information about the Digitalmars-d mailing list