mirror of
https://github.com/ruby/ruby.git
synced 2026-01-27 04:24:23 +00:00
Free default_rand_key after freeing Ractors
Ractor's free iterates through its TLS keys so we need to keep this
memory available until after Ractors are freed.
Minimal reproduction:
RUBY_FREE_AT_EXIT=1 ./miniruby -e rand
This commit is contained in:
parent
697a096c9b
commit
339978ef38
2
vm.c
2
vm.c
@ -2994,7 +2994,6 @@ ruby_vm_destruct(rb_vm_t *vm)
|
||||
rb_thread_t *th = vm->ractor.main_thread;
|
||||
VALUE *stack = th->ec->vm_stack;
|
||||
if (rb_free_at_exit) {
|
||||
rb_free_default_rand_key();
|
||||
rb_free_encoded_insn_data();
|
||||
rb_free_global_enc_table();
|
||||
rb_free_loaded_builtin_table();
|
||||
@ -3056,6 +3055,7 @@ ruby_vm_destruct(rb_vm_t *vm)
|
||||
if (rb_free_at_exit) {
|
||||
rb_objspace_free_objects(objspace);
|
||||
rb_free_generic_iv_tbl_();
|
||||
rb_free_default_rand_key();
|
||||
if (th) {
|
||||
xfree(stack);
|
||||
ruby_mimfree(th);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user