From ca032d5eeaf81692f89f35c55450dcb97df59e16 Mon Sep 17 00:00:00 2001 From: Koichi Sasada Date: Thu, 23 Dec 2021 15:51:13 +0900 Subject: undef `rb_vm_lookup_overloaded_cme()` Some callable method entries (cme) can be a key of `overloaded_cme_table` and the keys should be pinned because the table is numtable (VALUE is a key). Before the patch GC checks the cme is in `overloaded_cme_table` by looking up the table, but it needs VM locking. It works well in normal GC marking because it is protected by the VM lock, but it doesn't work on `rb_objspace_reachable_objects_from` because it doesn't use VM lock. Now, the number of target cmes are small enough, I decide to pin down all possible cmes instead of using looking up the table. --- vm_method.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'vm_method.c') diff --git a/vm_method.c b/vm_method.c index b8197e14ca..38d03fbe2b 100644 --- a/vm_method.c +++ b/vm_method.c @@ -979,12 +979,13 @@ lookup_overloaded_cme(const rb_callable_method_entry_t *cme) return monly_cme; } -// used by gc.c +#if VM_CHECK_MODE > 0 MJIT_FUNC_EXPORTED const rb_callable_method_entry_t * rb_vm_lookup_overloaded_cme(const rb_callable_method_entry_t *cme) { return lookup_overloaded_cme(cme); } +#endif static void delete_overloaded_cme(const rb_callable_method_entry_t *cme) -- cgit v1.2.3