httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Hyde <bh...@pobox.com>
Subject Re: [APR] Universal return syntax
Date Sat, 23 Jan 1999 18:35:38 GMT

Dean Gaudet writes:
>On Fri, 22 Jan 1999, Ben Hyde wrote:
>
>> Dean Gaudet writes:
>> >I don't see the point, most of the string operations have no failure code
>> >to diagnose.
>> 
>> Routines that never have exceptions ought not be charged the tax of
>> the in-line exception hand waving we must pay now that we have
>> forsworn longjmp, thread destruction, and all the other fun
>> exuberant operations.
>
>I could live with longjmp based exception handling if it's general
>enough. ...

Oh happy day.

I have along standing fear of longjmp since it has been so buggy over
the years.  That fear and some things we had discussed a year ago
about Mozilla's coding conventions had mutated in my mind to the
belief that we had decided to forswear longjmp entirely.  What the
Mozilla conventions actually say is that you can't use C++ exceptions
<http://www.mozilla.org/docs/tplist/catBuild/portable-cpp.html#dont_use_exceptions>

So - way to go.  I'd be very happy to attempt to adopt an exception
handling framework.  I've written a mess of C code under that
style and it's a delight.  The only down side is that setjmp is
usually a disgustingly expensive operations, but at least it's
all in user space.

3rd party libraries will have to do glue to at their interfaces
no matter what error model is adopted.

>Essentially something like this:
>
>    switch (ap_push_exception_handler(p)) {
>    case REGISTERED:
>	break;
>    case OUT_OF_MEMORY:
>	whatever...
>    }
>    ...
>    ap_pop_exception_handler(p);


Mime
View raw message