This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC] Marking C++ new operator as malloc?
- From: "Kaveh R. GHAZI" <ghazi at caip dot rutgers dot edu>
- To: Martin Jambor <jamborm at matfyz dot cz>
- Cc: GCC Mailing List <gcc at gcc dot gnu dot org>
- Date: Fri, 7 Sep 2007 21:26:29 -0400 (EDT)
- Subject: Re: [RFC] Marking C++ new operator as malloc?
- References: <20070907205343.GA22936@matfyz.cz>
On Fri, 7 Sep 2007, Martin Jambor wrote:
> Index: libstdc++-v3/libsupc++/new
> ===================================================================
> --- libstdc++-v3/libsupc++/new (revision 128207)
> +++ libstdc++-v3/libsupc++/new (working copy)
> @@ -92,7 +92,8 @@
> * Placement new and delete signatures (take a memory address argument,
> * does nothing) may not be replaced by a user's program.
> */
> -void* operator new(std::size_t) throw (std::bad_alloc);
> +void* operator new(std::size_t) throw (std::bad_alloc)
> + __attribute__ ((malloc));
> void* operator new[](std::size_t) throw (std::bad_alloc);
> void operator delete(void*) throw();
> void operator delete[](void*) throw();
If this is accepted, IMHO you should use __attribute__((__malloc__)) not
__attribute__ ((malloc)).
Thanks,
--Kaveh
--
Kaveh R. Ghazi ghazi@caip.rutgers.edu