Re: exceptions

Jeff Hostetler (jeff@abisource.com)
Fri, 28 May 1999 09:05:56 -0500


At 08:14 PM 5/27/99 -0600, Matt Kimball wrote:
>On Thu, May 27, 1999 at 10:33:33AM -0700, Darren O. Benham wrote:
>> are exceptions (try, catch, throw) part of the c++ subset abi is using?
>> if not, what is the abi-prefered way to abort the contruction of a class
>> if.. say.. there's not enough memory?
>
>I don't speak for Abi, but according to the Programmer Guidelines in
>the docs directory, you shouldn't use exceptions. From reading the
>code, it seems to me that the standard way to deal with it is to not
>allocate any memory in a constructor. Instead, just initialize to
>some NULL state and then have an initialization function which can
>return false if, say, memory allocation fails. Seems sensible to me.

yes that's the general idea. we do have a few constructors
which do malloc, but generally we try to avoid it. if you
do need to allocate something let it fail gracefully into
a zombie object or something.

jeff



This archive was generated by hypermail 1.03b2.