[Boost-bugs] [Boost C++ Libraries] #11414: minor problem in libs/pool/example/sys_allocator.hpp

Subject: [Boost-bugs] [Boost C++ Libraries] #11414: minor problem in libs/pool/example/sys_allocator.hpp
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-06-23 00:16:41


#11414: minor problem in libs/pool/example/sys_allocator.hpp
---------------------------------------+------------------------------
 Reporter: Ed Vogel <edward.vogel@…> | Type: Bugs
   Status: new | Milestone: To Be Determined
Component: None | Version: Boost 1.57.0
 Severity: Problem | Keywords:
---------------------------------------+------------------------------
 In sys_allocator.hpp the struct new_delete_allocator has a minor issue.

 The code is:

   static pointer allocate(const size_type n, const void* = 0)
   { return (pointer) new char[n * sizeof(T)]; }
   static void deallocate(const pointer p, const size_type)
   { delete [] p; }

 Note that the deallocate member function calls array delete, but the
 allocate function does not call array new. According to the standard
 this is invalid.

 The HP NonStop runtime will generate an assert failure on the call
 to the delete.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/11414>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:18 UTC