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: C++ std headers and malloc, realloc poisoning


On 12/04/2013 04:03 PM, Jakub Jelinek wrote:
I think the most important reason is that we want to handle out of mem
cases consistently, so instead of malloc etc. we want users to use xmalloc
etc. that guarantee non-NULL returned value, or fatal error and never
returning.  For operator new that is solvable through std::set_new_handler
I guess, but for malloc we really don't want people to deal with checking
NULL return values from those everywhere.

A simple workaround would be to disable poisoning of malloc/realloc on OS X (or when the build machine uses libc++, if that's easy to detect).

Jason


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