ruby-changes:64488
From: Kenta <ko1@a...>
Date: Wed, 23 Dec 2020 09:25:34 +0900 (JST)
Subject: [ruby-changes:64488] 9636d14f6f (master): [memory_view] Acquire VM lock while running exported_object_registry_free
https://git.ruby-lang.org/ruby.git/commit/?id=9636d14f6f From 9636d14f6f4a1dc21ca61c280b26ec8fb3935168 Mon Sep 17 00:00:00 2001 From: Kenta Murata <mrkn@m...> Date: Wed, 23 Dec 2020 00:51:26 +0900 Subject: [memory_view] Acquire VM lock while running exported_object_registry_free exported_object_registry is freed at exit, so this change is just in case. diff --git a/memory_view.c b/memory_view.c index 2d4f9dc..a1ab240 100644 --- a/memory_view.c +++ b/memory_view.c @@ -51,11 +51,11 @@ exported_object_registry_mark(void *ptr) https://github.com/ruby/ruby/blob/trunk/memory_view.c#L51 static void exported_object_registry_free(void *ptr) { - // Note that calling RB_VM_LOCK_ENTER here is unnecessary now. - // But it may be changed in the future. + RB_VM_LOCK_ENTER(); st_clear(exported_object_table); st_free_table(exported_object_table); exported_object_table = NULL; + RB_VM_LOCK_LEAVE(); } const rb_data_type_t rb_memory_view_exported_object_registry_data_type = { -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/