Opened 10 years ago

Last modified 10 years ago

#6867 new Bugs

Unclear behavior of parameter 'max_size'

Reported by: edupuis Owned by: John Maddock
Milestone: To Be Determined Component: pool
Version: Boost 1.49.0 Severity: Cosmetic
Keywords: Cc:

Description

When constructing a pool, a 'max_size' parameter can be given. If non zero, the documentation states that the pool will not allow more than 'max_chunks' at once.

However, this restriction is not taken into account in function ordered_malloc(n) :

boost::pool<> p(sizeof(int), 16, 16);

void *ptr = p.ordered_malloc(32);  // Succeeds

Either the documentation should be precised, either the illustrated allocation should fail.

Change History (4)

comment:1 by edupuis, 10 years ago

Status: newassigned

comment:2 by edupuis, 10 years ago

Resolution: fixed
Status: assignedclosed

(In [78337]) Improved coherency between 'next_size' and 'max_size'; the first one is now always smaller or equal to the second one. No mallocs of more than 'max_size' chunks at once are allowed. Documentation will need update. This fixes #6867.

comment:3 by edupuis, 10 years ago

Resolution: fixed
Status: closedreopened

comment:4 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.