Re: [Boost-bugs] [Boost C++ Libraries] #1252: [pool] severe overhead with unaligned sizes.

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #1252: [pool] severe overhead with unaligned sizes.
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-05-02 10:03:44


#1252: [pool] severe overhead with unaligned sizes.
--------------------------------+-------------------------------------------
  Reporter: phrosty_at_[hidden] | Owner: cnewbold
      Type: Bugs | Status: assigned
 Milestone: To Be Determined | Component: pool
   Version: Boost 1.34.1 | Severity: Problem
Resolution: | Keywords: pool
--------------------------------+-------------------------------------------
Changes (by klin <kevin.ic_at_[hidden]>):

 * cc: kevin.ic_at_[hidden] (added)

Comment:

 Would it be more efficient to simply ignore the alignment requirements for
 the pointers, and just copy in and out of the memory using aligned
 addresses before using them?

 So we can always allocate in multiples of requested_size (large enough to
 cover min_size). Then, to access embedded data such as the next pointer,
 we can do:


 {{{
 void* get_nextof(void const* ptr)
 {
  void* p;
  memcpy(&p, ptr, sizeof(void*));
  return p;
 }
 }}}


 Seems like the copying penalty would be worth it for a more reasonable
 overhead.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/1252#comment:12>
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:00 UTC