std::allocator should use sized delete

Marc Glisse marc.glisse@inria.fr
Fri Jun 7 07:50:00 GMT 2019


On Fri, 7 Jun 2019, Victor via libstdc++ wrote:

> On Fri, 7 Jun 2019 09:12:20 +0200 (CEST)
> Marc Glisse <marc.glisse@inria.fr> wrote:
>> On Fri, 7 Jun 2019, Victor via libstdc++ wrote:
>> 
>> What file did you check in what version? It does use the sized version 
>> here.
>> 
>> -- 
>> Marc Glisse
>
> /opt/gcc-9.1/include/c++/9.1.0/ext/new_allocator.h
>
>      void
>      deallocate(pointer __p, size_type)
>      {
> #if __cpp_aligned_new
> 	if (alignof(_Tp) > __STDCPP_DEFAULT_NEW_ALIGNMENT__)
> 	  {
> 	    ::operator delete(__p, std::align_val_t(alignof(_Tp)));
> 	    return;
> 	  }
> #endif
> 	::operator delete(__p);
>      }
>

Please check the repository

https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=libstdc%2B%2B-v3/include/ext/new_allocator.h;h=ee699532c6a2bc32bef827a9ecccbea15edfe579;hb=HEAD#l123

-- 
Marc Glisse



More information about the Libstdc++ mailing list