1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[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.
This commit is contained in:
Kenta Murata 2020-12-23 00:51:26 +09:00
parent 01ab29cc28
commit 9636d14f6f
No known key found for this signature in database
GPG key ID: CEFE8AFB6081B062

View file

@ -51,11 +51,11 @@ exported_object_registry_mark(void *ptr)
static void static void
exported_object_registry_free(void *ptr) exported_object_registry_free(void *ptr)
{ {
// Note that calling RB_VM_LOCK_ENTER here is unnecessary now. RB_VM_LOCK_ENTER();
// But it may be changed in the future.
st_clear(exported_object_table); st_clear(exported_object_table);
st_free_table(exported_object_table); st_free_table(exported_object_table);
exported_object_table = NULL; exported_object_table = NULL;
RB_VM_LOCK_LEAVE();
} }
const rb_data_type_t rb_memory_view_exported_object_registry_data_type = { const rb_data_type_t rb_memory_view_exported_object_registry_data_type = {