runtime hook for Crash on Error

deadalnix deadalnix at gmail.com
Tue Jun 5 13:28:13 PDT 2012


Le 04/06/2012 21:29, Steven Schveighoffer a écrit :
> On Mon, 04 Jun 2012 06:20:56 -0400, Don Clugston <dac at nospam.com> wrote:
>
>> 1. There exist cases where you cannot know why the assert failed.
>> 2. Therefore you never know why an assert failed.
>> 3. Therefore it is not safe to unwind the stack from a nothrow function.
>>
>> Spot the fallacies.
>>
>> The fallacy in moving from 2 to 3 is more serious than the one from 1
>> to 2: this argument is not in any way dependent on the assert occuring
>> in a nothrow function. Rather, it's an argument for not having
>> AssertError at all.
>
> I'm not sure that is the issue here at all. What I see is that the
> unwinding of the stack is optional, based on the assumption that there's
> no "right" answer.
>
> However, there is an underlying driver for not unwinding the stack --
> nothrow. If nothrow results in the compiler optimizing out whatever
> hooks a function needs to properly unwind itself (my limited
> understanding is that this helps performance), then there *is no
> choice*, you can't properly unwind the stack.
>
> -Steve

It change nothing in term of performances as long as you not throw. And 
when you throw, performance are not your main problem.


More information about the Digitalmars-d mailing list