array new-expressions: proposal

Martin von Loewis loewis at informatik.hu-berlin.de
Mon Jan 24 18:05:58 UTC 2000


> My understanding is that the new expression would first store the
> number of elements to be destructed.  That means that besides just
> specifying a this pointer to the repeated ctor calls, we also clobber
> another location in the buffer.  That prevents me to overconstruct
> subarrays and the like.
> 
> Or do I misunderstand?

No, you are right, overconstructing of sub-arrays would not work.

I believe standard C++ does not support overconstruction of arrays,
because it allows arbitrary padding before the first element. OTOH, I
can see that this is a useful feature.

It seems to me that not having the array size in a placement-new
breaks the requirement that the corresponding delete expression will
call all element's destructors (in reverse order). If that is a
limitation of the ABI, that's fine with me. 

Regards,
Martin




More information about the cxx-abi-dev mailing list