Fix inconsistent operator delete usages

François Dumont frs.dumont@gmail.com
Thu Jan 31 21:29:00 GMT 2019


     I was writing a test which needed to override the std::nothrow 
versions of the operator new and delete to control get_temporary_buffer 
behavior and noticed that it is inconsistent with 
release_temporary_buffer in terms of new/delete operators.

     Grepping for other std::nothrow usages I found some others and 
especially one in libsupc++.

     I don't know how serious it is considering the Standard. As long as 
you stick to the libstdc++ operators it is fine. Only users overriding 
those operators will notice.

     Tested under Linux x86_64 normal mode with some failures but none 
related to this patch I think but of course you better check on your side.

     * libsupc++/atexit_thread.cc (run(void*)): Call std::nothrow delete
     operator.
     * include/bits/stl_tempbuf.h (return_temporary_buffer): Likewise.
     * include/profile/impl/profiler_trace.h
     (__trace_base<>::~__trace_base()): Likewise.
     (__trace_base<>::__add_object(__stack_t)): Likewise.
     (__trace_base<>::__retire_object(__stack_t)): Likewise.

Let me know if it is a go.

François

-------------- next part --------------
A non-text attachment was scrubbed...
Name: delete_nothrow.patch
Type: text/x-patch
Size: 2303 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20190131/710e752a/attachment.bin>


More information about the Libstdc++ mailing list