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: [RFC] Marking C++ new operator as malloc?


Chris Lattner wrote:
I understand, but allowing users to override new means that the actual implementation may not honor the aliasing guarantees of attribute malloc.

-Chris

On Sep 7, 2007, at 10:12 PM, Joe Buck <Joe.Buck@synopsys.COM> wrote:


On Sep 7, 2007, at 1:53 PM, Martin Jambor wrote:
[ giving operator new the malloc property ]

On Fri, Sep 07, 2007 at 06:30:33PM -0700, Chris Lattner wrote:
It is unclear whether this is safe.  Nothing in the standard AFAIK
requires the operator new be implemented in terms of malloc, and
users are allowed to override it.

Maybe it could make sense to give the malloc attribute only to ::operator new but not to other new-s, in particular not to the placement new?


But I am not a C++ expert!

Regards.


-- Basile STARYNKEVITCH http://starynkevitch.net/Basile/ email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359 8, rue de la Faiencerie, 92340 Bourg La Reine, France *** opinions {are only mines, sont seulement les miennes} ***


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