radical ideas about GC and ARC : need to be time driven?

Kagamin via Digitalmars-d digitalmars-d at puremagic.com
Tue May 13 23:44:43 PDT 2014


On Tuesday, 13 May 2014 at 17:53:10 UTC, Marc Schütz wrote:
> Currently it isn't, because the GC sometimes lacks type 
> information, e.g. for dynamic arrays.

Will RC be guaranteed to always have type information? If it can, 
why GC can't? If it can't, what's the difference?

On Tuesday, 13 May 2014 at 18:07:42 UTC, Marc Schütz wrote:
> It's not (memory) unsafe because you cannot delete live objects 
> accidentally, but it's "unsafe" because it leaks resources. 
> Imagine a file object that relies on the destructor closing the 
> file descriptor. You will quickly run out of FDs...

It's the same situation in .net, where GC doesn't guarantee 
calling finalizers of arbitrary classes in all scenarios, they 
have to be special classes like SafeHandle, and resource handles 
are usually implemented deriving from SafeHandle. Is it 
constructive to require D GC be better than .net GC?


More information about the Digitalmars-d mailing list