vector new and delete

Mark Mitchell mark at codesourcery.com
Thu Jun 29 01:26:12 UTC 2000


>>>>> "Jim" == Jim Dehnert <dehnert at baalbek.engr.sgi.com> writes:

    Jim> On looking at the current routines, it strikes me that, since
    Jim> they only do construction and destruction, it makes no sense
    Jim> for the __cxx_vec_ctor to have a NULL constructor, nor for
    Jim> __cxx_vec_dtor to have a NULL destructor, as suggested by the
    Jim> comments.  Am I missing something?

Well, the __cxa_vec_ctor routine will fill in the padding, even if
there is no constructor.  That's useful.

I think we should try to make these routines easy/safe to call --
rather than trying to make them efficient.  Efficient compilers will
inline the body of these routines, effectively.  The point of these
routines is to easily generate code, and to generate code that is
optimized for space.  In those cases, it may be convenient not to have
to test for NULL outside of the routines -- so I think the current
approach is good.

--
Mark Mitchell                   mark at codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com




More information about the cxx-abi-dev mailing list