mirror of
https://github.com/ruby/ruby.git
synced 2026-01-27 12:34:21 +00:00
Fix size assertion in concurrent set resizing
Since we resize when `prev_size > set->capacity / 2`, it's possible that `prev_size == set->capacity / 2`, so we need to change the assertion in concurrent_set_try_resize_without_locking to be `new_set->size <= new_set->capacity / 2`.
This commit is contained in:
parent
05f51cf36a
commit
dafc4e131e
@ -139,7 +139,7 @@ concurrent_set_try_resize_without_locking(VALUE old_set_obj, VALUE *set_obj_ptr)
|
||||
if (entry->key == CONCURRENT_SET_EMPTY) {
|
||||
new_set->size++;
|
||||
|
||||
RUBY_ASSERT(new_set->size < new_set->capacity / 2);
|
||||
RUBY_ASSERT(new_set->size <= new_set->capacity / 2);
|
||||
RUBY_ASSERT(entry->hash == 0);
|
||||
|
||||
entry->key = key;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user