I hate class destructors with a burning passion

mw mingwu at gmail.com
Sun Jun 6 17:48:18 UTC 2021


On Sunday, 6 June 2021 at 17:42:40 UTC, mw wrote:
> 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:
>>>[...]
>>
>> 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


We can even add a compiler flag: let the developer specify the 
buffer size, e.g. in debug build: 1024 * 100, and 1024 or 0 in 
release build.


> 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