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?


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


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