Ticket #284: boost_pool.patch
File boost_pool.patch, 1.4 KB (added by , 15 years ago) |
---|
-
pool.hpp
old new 153 153 const simple_segregated_storage<size_type> & store() const { return *this; } 154 154 const size_type requested_size; 155 155 size_type next_size; 156 size_type start_size; 156 157 157 158 // finds which POD in the list 'chunk' was allocated from 158 159 details::PODptr<size_type> find_POD(void * const chunk) const; … … 192 193 // pre: npartition_size != 0 && nnext_size != 0 193 194 explicit pool(const size_type nrequested_size, 194 195 const size_type nnext_size = 32) 195 :list(0, 0), requested_size(nrequested_size), next_size(nnext_size) 196 :list(0, 0), requested_size(nrequested_size), next_size(nnext_size), start_size(nnext_size) 196 197 { } 197 198 198 199 ~pool() { purge_memory(); } … … 208 209 209 210 // These functions are extensions! 210 211 size_type get_next_size() const { return next_size; } 211 void set_next_size(const size_type nnext_size) { next_size = nnext_size; }212 void set_next_size(const size_type nnext_size) { next_size = nnext_size; start_size = nnext_size; } 212 213 213 214 // Both malloc and ordered_malloc do a quick inlined check first for any 214 215 // free chunks. Only if we need to get another memory block do we call … … 419 420 420 421 list.invalidate(); 421 422 this->first = 0; 423 424 next_size = start_size; 422 425 423 426 return true; 424 427 }