I hate class destructors with a burning passion

max haughton maxhaton at gmail.com
Wed Jun 9 22:46:35 UTC 2021


On Wednesday, 9 June 2021 at 21:44:20 UTC, Walter Bright wrote:
> On 6/9/2021 7:01 AM, Steven Schveighoffer wrote:
>> I'm 99% sure we could have a nogc stack trace for 
>> InvalidMemoryOperationError if we had a nogc demangler. 
>> Everything else seems already nogc, just not fully marked.
>
> I don't believe it would be hard to make a nogc demangler, even 
> if it used malloc.
>
> Even better, provide a "sink" parameter for the result, and 
> have the demangler defer its final allocation needs to the 
> caller, and free its temporary data itself.

The issue with the druntime demangler at the moment seems to be 
that it basically implements a state machine (pretty normal so 
far) then uses exceptions to backtrack on itself. The code is not 
good.


More information about the Digitalmars-d mailing list