Opened 18 years ago

Last modified 15 years ago

#284 closed Bugs (fixed)

pool::purge_memory() does not reset next_size — at Version 7

Reported by: nobody Owned by: shammah
Milestone: Boost 1.35.0 Component: pool
Version: Boost 1.34.0 Severity: Problem
Keywords: Cc: witt@…

Description (last modified by Marshall Clow)

Calling purge_memory() does not reset next_size in the 
memory pool implementation.

This means that repeatedly allocating then calling 
purge_memory() causes the pool to allocate a buffer of 
double the size each time, even though the number of 
objects remains small.

Thanks,

Edmund Kapusniak.


Change History (8)

comment:1 by fizzgig, 16 years ago

Logged In: YES 
user_id=197414
Originator: NO

This bug is still here. A workaround is to call set_next_size() after purge memory. However, it should be a very easy fix.

comment:2 by Thomas Witt, 15 years ago

Milestone: Boost 1.34.1
Severity: Problem
Version: Nonerelease 1.34.0

comment:3 by Thomas Witt, 15 years ago

Cc: witt@… added

comment:4 by Thomas Witt, 15 years ago

Milestone: Boost 1.34.1Boost 1.35.0

comment:5 by Marcus Lindblom <macke@…>, 15 years ago

Attached patch adds a new member (start_size) and which is the value of next_size as set in constructor or via set_next_size. It is used to reset next_size in purge_memory.

by Marcus Lindblom <macke@…>, 15 years ago

Attachment: boost_pool.patch added

Patch that adresses this bug

comment:6 by lang@…, 15 years ago

Hi, the attached patch is not completely correct - there is the same problem in method release_memory() and it should be also fixed.

Lada

comment:7 by Marshall Clow, 15 years ago

Component: Nonepool
Description: modified (diff)
Note: See TracTickets for help on using tickets.