--- \temp\pool\pool.hpp Mon Dec 04 08:06:00 2006 +++ pool.hpp Mon Jun 11 17:13:06 2007 @@ -153,6 +153,7 @@ const simple_segregated_storage & store() const { return *this; } const size_type requested_size; size_type next_size; + size_type start_size; // finds which POD in the list 'chunk' was allocated from details::PODptr find_POD(void * const chunk) const; @@ -192,7 +193,7 @@ // pre: npartition_size != 0 && nnext_size != 0 explicit pool(const size_type nrequested_size, const size_type nnext_size = 32) - :list(0, 0), requested_size(nrequested_size), next_size(nnext_size) + :list(0, 0), requested_size(nrequested_size), next_size(nnext_size), start_size(nnext_size) { } ~pool() { purge_memory(); } @@ -208,7 +209,7 @@ // These functions are extensions! size_type get_next_size() const { return next_size; } - void set_next_size(const size_type nnext_size) { next_size = nnext_size; } + void set_next_size(const size_type nnext_size) { next_size = nnext_size; start_size = nnext_size; } // Both malloc and ordered_malloc do a quick inlined check first for any // free chunks. Only if we need to get another memory block do we call @@ -419,6 +420,8 @@ list.invalidate(); this->first = 0; + + next_size = start_size; return true; }