"Ola Theander" <[EMAIL PROTECTED]> wrote in message
news:65622@palm-dev-forum...
>
> Dear subscribers.
>
> I've recently begun to develop for the Palm OS platform and have a
question
> regarding exception handling. Is there any reason to prefer the
ErrTry,
> ErrCatch and ErrThrow mechanism before the C++ standard
exception-handling
> scheme of try, catch and throw? After all, I would prefer to use the
> standard if ther is no disadvantage.
>
> My current tool is CW 7.0. Would the recommendation be any different
if I
> would have used the GNU C++ compiler?

The big disadvantage of using the Palm OS exception calls is that C++
destructors will not be called.  If your code is mostly C with just a
few C++ features, this is OK, but if you're using lots of C++ classes, I
don't think bypassing destructors will be acceptable.

The CW exception handling mechanism is pretty good.  There is no speed
penalty for using exceptions in the normal case where no exception is
thrown.  When a throw happens, the runtime library uses tables stored in
the global data space to determine where the exception handlers are and
what destructors to call.  In CW Palm 8, these exception tables can be
stored in the storage heap, allowing their use without eating into your
MemHandleNew and MemPtrNew space.



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to