From a36fcc5d55c1de84ae68c1091ebff2b1c32dc3b7 Mon Sep 17 00:00:00 2001 From: Kenneth Heafield Date: Wed, 10 Oct 2012 19:02:40 +0100 Subject: KenLM 8307220 --- klm/util/probing_hash_table.hh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'klm/util/probing_hash_table.hh') diff --git a/klm/util/probing_hash_table.hh b/klm/util/probing_hash_table.hh index 3354b68e..770faa7e 100644 --- a/klm/util/probing_hash_table.hh +++ b/klm/util/probing_hash_table.hh @@ -8,6 +8,7 @@ #include #include +#include namespace util { @@ -42,8 +43,8 @@ template (multiplier * static_cast(entries))); + static uint64_t Size(uint64_t entries, float multiplier) { + uint64_t buckets = std::max(entries + 1, static_cast(multiplier * static_cast(entries))); return buckets * sizeof(Entry); } -- cgit v1.2.3