This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: I'm sorry, but this is unacceptable (union members and ctors)


On 6/16/07, michael.a <wild.eyed.boy.from.freecloud@gmail.com> wrote:

As for "placement new", from what I can find, it is unsafe to use with any memory that isn't part of the heap.
Huh?????  It can be used with stack variables, we have tests in the
testsuite where we use it with such.

As for the discussion of unions, placement new is way too much overhead.

placement new has no overhead, that is by design. I literally mean placement new does nothing except for changing the dynamic type and calling the constructor. Where is the overhead there? I see unions having more overhead than placement new as unions are not as well optimized.

-- Pinski


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]