Re: [Boost-bugs] [Boost C++ Libraries] #11312: smart_ptr::detail::as_allocator::allocate() adds alignment padding when it's not needed

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #11312: smart_ptr::detail::as_allocator::allocate() adds alignment padding when it's not needed
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-05-17 05:08:16


#11312: smart_ptr::detail::as_allocator::allocate() adds alignment padding when
it's not needed
----------------------------------+-----------------------
  Reporter: David Aue <david@…> | Owner: glenfe
      Type: Bugs | Status: new
 Milestone: To Be Determined | Component: smart_ptr
   Version: Boost 1.57.0 | Severity: Problem
Resolution: | Keywords:
----------------------------------+-----------------------

Comment (by glenfe):

 One optimization I could do is instead of adding `alignof(type)` bytes:
  * If `alignof(value_type) >= align(type)` then do not add any additional
 padding.
  * Else add `alignof(type) - 1` bytes for padding.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/11312#comment:4>
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