aboutsummaryrefslogtreecommitdiffstats
path: root/method.h
diff options
context:
space:
mode:
authorKoichi Sasada <ko1@atdot.net>2021-12-21 06:03:51 +0900
committerKoichi Sasada <ko1@atdot.net>2021-12-21 11:03:09 +0900
commitdf48db987da2bd623d29d06419f2fbc8b7ecb38a (patch)
treeed86fd0472dd5885581e21c7947afafff4eef483 /method.h
parent711342d93565092a8348ac5538bc4b4288d384ba (diff)
downloadruby-df48db987da2bd623d29d06419f2fbc8b7ecb38a.tar.gz
`mandatory_only_cme` should not be in `def`
`def` (`rb_method_definition_t`) is shared by multiple callable method entries (cme, `rb_callable_method_entry_t`). There are two issues: * old -> young reference: `cme1->def->mandatory_only_cme = monly_cme` if `cme1` is young and `monly_cme` is young, there is no problem. Howevr, another old `cme2` can refer `def`, in this case, old `cme2` points young `monly_cme` and it violates gengc assumption. * cme can have different `defined_class` but `monly_cme` only has one `defined_class`. It does not make sense and `monly_cme` should be created for a cme (not `def`). To solve these issues, this patch allocates `monly_cme` per `cme`. `cme` does not have another room to store a pointer to the `monly_cme`, so this patch introduces `overloaded_cme_table`, which is weak key map `[cme] -> [monly_cme]`. `def::body::iseqptr::monly_cme` is deleted. The first issue is reported by Alan Wu.
Diffstat (limited to 'method.h')
-rw-r--r--method.h1
1 files changed, 0 insertions, 1 deletions
diff --git a/method.h b/method.h
index 8bff5b3b8d..815fd9da47 100644
--- a/method.h
+++ b/method.h
@@ -134,7 +134,6 @@ typedef struct rb_iseq_struct rb_iseq_t;
typedef struct rb_method_iseq_struct {
const rb_iseq_t * iseqptr; /*!< iseq pointer, should be separated from iseqval */
rb_cref_t * cref; /*!< class reference, should be marked */
- const rb_callable_method_entry_t *mandatory_only_cme;
} rb_method_iseq_t; /* check rb_add_method_iseq() when modify the fields */
typedef struct rb_method_cfunc_struct {