This is the mail archive of the gcc-patches@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: Ping: [PATCH] Install error handler for out-of-memory when using STL containers


Hi Tobi,

It looks straightforward to me but I am not convinced that a fortran
maintainer should be giving the green light on this :-)

Cheers

Paul

On 28 October 2012 16:28, Tobias Schlüter
<tobias.schlueter@physik.uni-muenchen.de> wrote:
>
> Ping.  This issue stands in the way of a very simple solution of PR
> fortran/51727.  I've re-attached the patch for your convenience.
>
> On 15 Oct 2012 at 22:51:05 +0200 Tobias Schlüter wrote:
>>
>> The attached patch adds out-of-memory diagnostics for code using STL
>> containers by using set_new_handler. Since the intended allocation
>> size is not available to a new_handler, I had to forego a more
>> detailed error message such as the one from xmalloc_failed().
>> fatal_error() and abort() don't give a meaningful location when the
>> new_handler is called, so I chose to put together the error message
>> manually as is done in xmalloc_failed(). I would have found it more
>> appealing to have operator new call xmalloc() unless a custom
>> allocator is given, but I don't think there's a standard way of doing
>> this.
>>
>> Built and tested on the C and Fortran testsuites. Ok for trunk?
>
>
> Best regards,
> - Tobi
>
> 2012-10-15  Tobias Schlüter  <tobi@gcc.gnu.org>
>
>         * toplev.c: Add '#include <new>'.
>         (cxx_out_of_memory): New function.
>         (general_init): Install cxx_out_of_memory as handler for
>         out-of-memory condition.



-- 
The knack of flying is learning how to throw yourself at the ground and miss.
       --Hitchhikers Guide to the Galaxy


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