summaryrefslogtreecommitdiff
path: root/vm_method.c
diff options
context:
space:
mode:
authorJean Boussier <jean.boussier@gmail.com>2025-07-29 15:13:01 +0200
committerJean Boussier <jean.boussier@gmail.com>2025-08-01 10:42:04 +0200
commitfc5e1541e4bb4b7995b6acc1ea6121b60fc64e7a (patch)
tree502509a59f9433d205a27b0875f30a3648d83569 /vm_method.c
parent1055e04e28a66b82d8c2118bb61763961ed4d1c9 (diff)
Use `rb_gc_mark_weak` for `cc->klass`.
One of the biggest remaining contention point is `RClass.cc_table`. The logical solution would be to turn it into a managed object, so we can use an RCU strategy, given it's read heavy. However, that's not currently possible because the table can't be freed before the owning class, given the class free function MUST go over all the CC entries to invalidate them. However if the `CC->klass` reference is weak marked, then the GC will take care of setting the reference to `Qundef`.
Diffstat (limited to 'vm_method.c')
-rw-r--r--vm_method.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/vm_method.c b/vm_method.c
index faf327b36c..327fcbafdd 100644
--- a/vm_method.c
+++ b/vm_method.c
@@ -409,7 +409,7 @@ invalidate_cc_refinement(st_data_t key, st_data_t data)
VM_ASSERT(vm_cc_refinement_p(cc));
- if (cc->klass) {
+ if (vm_cc_valid(cc)) {
vm_cc_invalidate(cc);
}
}