Skip to content

Commit 1ddb096

Browse files
committed
Remove opt. for cc_tbl dup on singletons
1 parent 0321aca commit 1ddb096

2 files changed

Lines changed: 1 addition & 13 deletions

File tree

vm_insnhelper.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2130,10 +2130,6 @@ vm_populate_cc(VALUE klass, const struct rb_callinfo * const ci, ID mid)
21302130
else {
21312131
if (rb_multi_ractor_p()) {
21322132
rcu_cc_tbl_p = true;
2133-
if (FL_TEST_RAW(klass, FL_SINGLETON)) {
2134-
VALUE attach = RCLASS_ATTACHED_OBJECT(klass);
2135-
rcu_cc_tbl_p = RB_TYPE_P(attach, T_CLASS) || RB_TYPE_P(attach, T_MODULE);
2136-
}
21372133
}
21382134
}
21392135

vm_method.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1835,16 +1835,8 @@ cache_callable_method_entry(VALUE klass, ID mid, const rb_callable_method_entry_
18351835
}
18361836
else {
18371837
bool needs_rcu_cc_tbl = false;
1838-
// NOTE: this is too strict of a check, it should check shareability of attached object. However,
1839-
// that's too slow. For now this should be fine.
18401838
if (!new_cc_tbl_p && rb_multi_ractor_p()) {
1841-
if (FL_TEST_RAW(klass, FL_SINGLETON)) {
1842-
VALUE attach = RCLASS_ATTACHED_OBJECT(klass);
1843-
needs_rcu_cc_tbl = RB_TYPE_P(attach, T_CLASS) || RB_TYPE_P(attach, T_MODULE);
1844-
}
1845-
else {
1846-
needs_rcu_cc_tbl = true;
1847-
}
1839+
needs_rcu_cc_tbl = true;
18481840
}
18491841
if (needs_rcu_cc_tbl) {
18501842
VALUE new_cc_tbl = rb_vm_cc_table_dup(cc_tbl, klass);

0 commit comments

Comments
 (0)