GC vs Resource management.

via Digitalmars-d digitalmars-d at puremagic.com
Sun May 4 04:56:23 PDT 2014


On Sunday, 4 May 2014 at 11:42:14 UTC, Marc Schütz wrote:
> On Saturday, 3 May 2014 at 12:28:03 UTC, monnoroch wrote:
>> Back to the dtors: i understand, that all the stuff you 
>> propose could make GC faster, simpler, and cooler,
>
> Note that this is _not_ the motivation behind the discussed 
> changes. It's primarily about correctness and consistency. What 
> we currently have if something that doesn't work at all in some 
> cases (dynamic arrays, new with structs), and where it does 
> work (class destructors) users have to conform to various rules 
> as to what is allowed in a GC-called destructor (e.g. don't 
> access references to other objects, don't throw (?), don't use 
> thread-local globals, any probably many more subtle rules), 
> that mostly cannot be enforced statically or even at runtime, 
> potentially causing silent corruption if you fail to comply 
> with them. This is IMO more than enough motivation to do 
> something about it.

Case in point:
http://forum.dlang.org/thread/vlnjgtdmyolgoiofnfnl@forum.dlang.org


More information about the Digitalmars-d mailing list