Use a set_table for rb_vm_struct.unused_block_warning_table

Now that we have a hash-set implementation we can use that
instead of a hash-table with a static value.
This commit is contained in:
Jean Boussier 2025-04-27 08:05:43 +02:00
parent 6874b289a1
commit 3ec7bfff2e
9 changed files with 83 additions and 7 deletions

4
vm.c
View file

@ -3131,7 +3131,7 @@ ruby_vm_destruct(rb_vm_t *vm)
rb_vm_postponed_job_free();
rb_id_table_free(vm->constant_cache);
st_free_table(vm->unused_block_warning_table);
set_free_table(vm->unused_block_warning_table);
xfree(th->nt);
th->nt = NULL;
@ -4306,7 +4306,7 @@ Init_BareVM(void)
vm->negative_cme_table = rb_id_table_create(16);
vm->overloaded_cme_table = st_init_numtable();
vm->constant_cache = rb_id_table_create(0);
vm->unused_block_warning_table = st_init_numtable();
vm->unused_block_warning_table = set_init_numtable();
// setup main thread
th->nt = ZALLOC(struct rb_native_thread);