From 783c57b2d3312738ddcf992ac55ff750afe7cb47 Mon Sep 17 00:00:00 2001 From: Kenneth Heafield Date: Mon, 27 Jan 2014 17:42:19 -0800 Subject: KenLM 5cc905bc2d214efa7de2db56a9a672b749a95591 --- klm/util/pool.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'klm/util/pool.cc') diff --git a/klm/util/pool.cc b/klm/util/pool.cc index db72a8ec..429ba158 100644 --- a/klm/util/pool.cc +++ b/klm/util/pool.cc @@ -25,9 +25,7 @@ void Pool::FreeAll() { } void *Pool::More(std::size_t size) { - // Double until we hit 2^21 (2 MB). Then grow in 2 MB blocks. - std::size_t desired_size = static_cast(32) << std::min(static_cast(16), free_list_.size()); - std::size_t amount = std::max(desired_size, size); + std::size_t amount = std::max(static_cast(32) << free_list_.size(), size); uint8_t *ret = static_cast(MallocOrThrow(amount)); free_list_.push_back(ret); current_ = ret + size; -- cgit v1.2.3