I hate class destructors with a burning passion

mw mingwu at gmail.com
Sun Jun 6 17:42:40 UTC 2021


On Sunday, 6 June 2021 at 15:01:31 UTC, apz28 wrote:
> On Sunday, 6 June 2021 at 11:54:40 UTC, Mathias LANG wrote:
>> Over the past few months, more than half of the critical bug 
>> we've encountered which were not due to our own code are 
>> related to destructors. Specifically, destructors being 
>> invoked by the GC.
>>
>
> Is there anyway to build runtime with pre-allocated buffer on 
> startup and use it to return error-text/stack-trace?
> This is how Delphi does for out of memory exception & when 
> using debug build runtime

That's a good idea, actually even a limited sized buffer is good 
enough, i.e the few top stack frames is mostly useful for the 
developers to identify the problem (even for stack overflow, e.g. 
recursion without termination condition).

@Mathias, hope this approach will take less work than you 
mentioned in the other post:

https://forum.dlang.org/post/hyayanlrcxuyljgetfms@forum.dlang.org


More information about the Digitalmars-d mailing list