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: Make the 2 versions of delete more similar


On 2 October 2013 13:28, Marc Glisse <marc.glisse@inria.fr> wrote:
> Hello,
>
> I don't understand why those 2 files differ by more than 1 extra argument,
> so I am changing that.
>
> Bootstrap and testsuite on x86_64.
>
> 2013-10-03  Marc Glisse  <marc.glisse@inria.fr>
>
>         * libsupc++/del_op.cc (operator delete): Don't test for 0 before
> free.

Just checking, for the nervous:

Is the plan that this change will not effect any code behaviour (as
correct implementations of free are happy to take a NULL pointer, and
not do anything)?

Chris


>  _GLIBCXX_WEAK_DEFINITION void
>  operator delete(void* ptr) _GLIBCXX_USE_NOEXCEPT
>  {
> -  if (ptr)
> -    std::free(ptr);
> +  std::free(ptr);
>  }


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