Opened 11 years ago

Last modified 10 years ago

#6610 new Feature Requests

customizing boost::pool/boost::object_pool via template parameter for ordered/non-ordered usage

Reported by: rad_d@… Owned by: John Maddock
Milestone: To Be Determined Component: pool
Version: Boost 1.48.0 Severity: Problem
Keywords: Cc: rad_d@…

Description

1. A documentation conflict between declaration and definition of boost::pool::purge_memory(). The definition documentation is

//! pool must be ordered

, but the declaration documentation does not provide this information.

2. Version of non-ordered boost::pool::release_memory()

Thereby there is the question - are there any differences in implementation or perfomance of ordered/non-ordered versions of this function?

3. Providing ordered/non-ordered release_memory() and purge_memory() for boost::object_pool

4. Efficient(non-ordered) construct/destroy of single objects in boost::object_pool(i.e. when boost::object_pool will be used for allocating single objects only, not arrays of objects)

5. Introduce some template parameter in the boost::object_pool(and in the boost::pool) in order to customize the pool for ordered/non-ordered or both usage.

Change History (6)

comment:1 by edupuis, 10 years ago

Owner: changed from Chris Newbold to edupuis
Status: newassigned

comment:2 by edupuis, 10 years ago

  1. Method boost::pool::purge_memory() does not require the pool to be ordered. Documentation has to be amended.
  1. Current implementation of boost::pool::release_memory() fails if the pool is not ordered. It could be implemented by adding a pool.order() function which could be called by the user to make an unordered pool ordered. The pool.order() function could also be called automatically if the pool maintains a boolean describing whether it is ordered or not.
  1. We could provide a gateway to release_memory() and to purge_memory(), the latter calling destructors of objects allocated, exactly what is already implemented in the destructor of object_pool.
  1. This is related to ticket #3789. In the current implementation, boost::object_pool can not be used to allocate arrays of objects.
  1. If ticket #3789 is resolved, this is probably not as needed. However, it could let a user choose between a slow 'object_pool::free()' or a slow 'object_pool::~object_pool()' as described in ticket #3789, although I fail to see relevant usages where one would choose a slow free. The suggested template parameter seems useless for boost::pool as the caller chooses between the ordered or unordered malloc/free functions.

Any comments ?

comment:3 by anonymous, 10 years ago

So, I agree with you. The behaviour as described in your comment in ticket #3789 is what I expected.

comment:4 by edupuis, 10 years ago

Resolution: fixed
Status: assignedclosed

(In [78454]) Added methods release_memory() and purge_memory() to object_pool. This complete and fixes #6610, as the remaining part of this ticket was addressed by #3789.

comment:5 by edupuis, 10 years ago

Resolution: fixed
Status: closedreopened

comment:6 by edupuis, 10 years ago

Owner: changed from edupuis to John Maddock
Status: reopenednew

https://svn.boost.org/svn/boost/sandbox/pool at revision 79460 contains a solution for tickets #3789, #5902, #6561, #6610, #6701, #6718, #6865 and #6867. Related test cases are also present.

https://svn.boost.org/svn/boost/sandbox/pool at revision 79460 does not contain any other new features or modifications other than those related to the above tickets.

Boost.Pool currently has no maintainer and is thus orphaned.

Note: See TracTickets for help on using tickets.