How D intercepts runtime errors

Sean Kelly sean at f4.ca
Thu Jul 27 11:37:02 PDT 2006


Jarrett Billingsley wrote:
> "Jarrett Billingsley" <kb3ctd2 at yahoo.com> wrote in message 
> news:eaak8g$1o0k$1 at digitaldaemon.com...
> 
>> All exception handling methods incur some performance penalty, but since 
>> access violations are implemented in the PC hardware, there is no 
>> performance penalty that you can't circumvent.
> 
> I meant to say "since access violations are implemented in the PC hardware, 
> there is a very slight performance penalty, but one which all programs 
> experience (the OS included) regardless of whether or not they're using 
> exception handling." 

It's uncommon (though not unheard of) for an application to 
intentionally dereference an invalid pointer, so the performance hit 
isn't a huge issue.  Stack unwinding as the exception propagates is what 
takes most of the time anyway.


Sean



More information about the Digitalmars-d mailing list