summaryrefslogtreecommitdiff
path: root/assoc.c
diff options
context:
space:
mode:
authordormando <dormando@rydia.net>2017-08-27 11:51:27 -0700
committerdormando <dormando@rydia.net>2017-08-27 11:51:27 -0700
commitc5b3ecba410477fc2ada57b77aa84d53694ed5a5 (patch)
treecabf0b13235aa6c8815e95705e72613952d2f18c /assoc.c
parent265d407fd817978f6e245a19eaca49a3c628fcf4 (diff)
downloadmemcached-c5b3ecba410477fc2ada57b77aa84d53694ed5a5.tar.gz
don't create hashtables larger than 32bit
most other stats related to items should be 64bit, so the totals should be ableable to go higher until we get 64bit hash tables.
Diffstat (limited to 'assoc.c')
-rw-r--r--assoc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/assoc.c b/assoc.c
index 792c07a..9d8c803 100644
--- a/assoc.c
+++ b/assoc.c
@@ -170,7 +170,8 @@ int assoc_insert(item *it, const uint32_t hv) {
pthread_mutex_lock(&hash_items_counter_lock);
hash_items++;
- if (! expanding && hash_items > (hashsize(hashpower) * 3) / 2) {
+ if (! expanding && hash_items > (hashsize(hashpower) * 3) / 2 &&
+ hashpower < HASHPOWER_MAX) {
assoc_start_expand();
}
pthread_mutex_unlock(&hash_items_counter_lock);