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:
Peter Zhu 2025-07-17 12:53:43 -04:00
parent 05f51cf36a
commit dafc4e131e

View File

@ -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;