[Mono-list] Exceptions and error codes.
Fergus Henderson
fjh@cs.mu.OZ.AU
Fri, 21 Mar 2003 19:29:15 +1100
On 21-Mar-2003, Richard Torkar <richard.torkar@htu.se> wrote:
> On Fri, 2003-03-21 at 04:10, Fergus Henderson wrote:
> > Note that the exception handling scheme used on Windows requires some
> > overhead for "try" statements even in the case when no exception is thrown.
>
> What? ^^^^^^^^^^^^^^ How can that be the case?
>
> If the catch does not fire then the try should not be evaluated, right?
> This is something I've missed completely.
The Win32 "structured exception handling" mechanism that Windows uses
keeps a linked list of active exception handlers. When entering a
"try" statement, the code generated by the compiler needs to insert
a new handler in the list, and to fill in a variety of fields that
record information about the handler. When exiting a "try" statement,
the generated code needs to remove the handler from the list.
--
Fergus Henderson <fjh@cs.mu.oz.au> | "I have always known that the pursuit
The University of Melbourne | of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh> | -- the last words of T. S. Garp.