[cxx-abi-dev] Allocator returning null during array construction (?)

Mark Mitchell mark at codesourcery.com
Fri Sep 5 22:45:17 UTC 2003


On Thu, 2003-09-04 at 06:40, Zagorodnev, Grigory wrote:
> The C++ Standard [clause 5.3.4, paragraph 13] says:
> "...If the allocation function is declared with an empty
> exception-specification, throw(), it returns null to indicate failure to
> allocate storage and a nonnull pointer otherwise. ] If the allocation
> function returns null, initialization shall not be done, the deallocation
> function shall not be called, and the value of the newexpression shall be
> null. "
> 
> The C++ ABI [clause 3.3.3], however, does not specify behaviour of array
> construction functions __cxa_vec_new2 and __cxa_vec_new3 for the case when
> allocator returns null.

You are correct; the functions should return NULL in that case.

I've attached a patch for the ABI here.  The web page will be updated
shortly.

-- 
Mark Mitchell
CodeSourcery, LLC
mark at codesourcery.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: diffs
Type: text/x-patch
Size: 4318 bytes
Desc: not available
URL: <http://sourcerytools.com/pipermail/cxx-abi-dev/attachments/20030905/e762759c/attachment.bin>


More information about the cxx-abi-dev mailing list