The GC and performance, but not what you expect

Joakim via Digitalmars-d digitalmars-d at puremagic.com
Tue Jun 10 13:19:21 PDT 2014


On Tuesday, 10 June 2014 at 17:58:56 UTC, Sean Kelly wrote:
> On Tuesday, 10 June 2014 at 17:07:23 UTC, Joakim wrote:
>> On Tuesday, 10 June 2014 at 15:15:46 UTC, Sean Kelly wrote:
>>> On Thursday, 29 May 2014 at 23:39:02 UTC, Marco Leise wrote:
>>>>
>>>> Nice try, but destructors called by the GC are currently
>>>> effectively @nogc. So don't try that at home.
>>>
>>> When did that happen?  Some effort was made at one point to 
>>> ensure that allocations worked from dtors.  Not that I'm in 
>>> favor, but...
>>
>> More than two years ago, possibly longer:
>>
>> https://issues.dlang.org/show_bug.cgi?id=7349
>
> That's a different issue, which is that the current GC isn't
> necessarily exception safe and throwing from a dtor violates
> this.  I don't see any mention there about allocating in a dtor.

I believe the mechanism is that the assert is triggered, it tries 
to allocate, then you get the invalid memory operation error.  
Exactly why it allocates, I'm not sure.


More information about the Digitalmars-d mailing list