More radical ideas about gc and reference counting

via Digitalmars-d digitalmars-d at puremagic.com
Fri May 2 03:09:24 PDT 2014


On Thursday, 1 May 2014 at 22:23:46 UTC, H. S. Teoh via 
Digitalmars-d wrote:
> On Thu, May 01, 2014 at 03:10:04PM -0700, Walter Bright via 
> Digitalmars-d wrote:
>> The thing is, GC is a terrible and unreliable method of 
>> managing
>> non-memory resource lifetimes. Destructors for GC objects are 
>> not
>> guaranteed to ever run. If you do have struct with a 
>> destructor as a
>> field in a class, you've got, at minimum, suspicious code and 
>> a latent
>> bug.
>
> Exactly!!! This is why I said we should ban the use of structs 
> with
> dtors as a field in a class.

No, not in a class, but in any GC-managed object. It's 
unfortunate that class currently implies GC.


More information about the Digitalmars-d mailing list