On 13/11/18 22:59 +0000, Jonathan Wakely wrote: >@@ -898,9 +907,10 @@ namespace pmr > { > auto p = std::lower_bound(std::begin(pool_sizes), std::end(pool_sizes), > opts.largest_required_pool_block); >- if (int npools = p - std::begin(pool_sizes)) >- return npools; >- return 1; >+ const int n = p - std::begin(pool_sizes); >+ if (p == std::end(pool_sizes) || *p == opts.largest_required_pool_block) This is wrong, it still chooses one pool too few when the block_size matches an element of pool_sizes[]. >+ return n; >+ return n + 1; > } Fixed by this patch, tested x86_64-linux and committed to trunk.