Fix for resizing
This commit is contained in:
parent
5df498fc20
commit
a9fe674446
@ -252,7 +252,7 @@ public void *Table$reserve(Table_t *t, const void *key, const void *value, const
|
||||
// Resize buckets if necessary
|
||||
if (t->entries.length >= (int64_t)t->bucket_info->count) {
|
||||
// Current resize policy: +50% at a time:
|
||||
uint32_t newsize = (3*(uint32_t)t->bucket_info->count)/2;
|
||||
uint32_t newsize = MAX(8, (uint32_t)(3*t->bucket_info->count)/2);
|
||||
if (unlikely(newsize > TABLE_MAX_BUCKETS))
|
||||
newsize = TABLE_MAX_BUCKETS;
|
||||
hashmap_resize_buckets(t, newsize, type);
|
||||
|
Loading…
Reference in New Issue
Block a user