Lazy init thread local storage

This commit is contained in:
Lourens Naudé 2019-07-20 02:42:10 +01:00 committed by Nobuyoshi Nakada
parent 642dbb962c
commit cadfaacb25
Notes: git 2019-09-23 02:15:08 +09:00
3 changed files with 25 additions and 8 deletions

2
vm.c
View file

@ -2727,7 +2727,6 @@ ruby_thread_init(VALUE self)
th->vm = vm;
th_init(th, self);
rb_ivar_set(self, rb_intern("locals"), rb_hash_new());
th->top_wrapper = 0;
th->top_self = rb_vm_top_self();
@ -3235,7 +3234,6 @@ Init_VM(void)
/* create main thread */
th_self = th->self = TypedData_Wrap_Struct(rb_cThread, &thread_data_type, th);
rb_iv_set(th_self, "locals", rb_hash_new());
vm->main_thread = th;
vm->running_thread = th;
th->vm = vm;