diff options
author | 卜部昌平 <[email protected]> | 2019-09-23 17:42:27 +0900 |
---|---|---|
committer | 卜部昌平 <[email protected]> | 2019-09-30 10:26:38 +0900 |
commit | 595b3c4fddc5cde58add2fa2637acb2664694194 (patch) | |
tree | 6a77f258999c267804556506a7fef3751ed44af8 /vm_insnhelper.c | |
parent | 1521f7cf89fe3cf356a589c45bce4ccb57dce7fd (diff) |
refactor rb_method_definition_create take opts
Before this changeset rb_method_definition_create only allocated a
memory region and we had to destructively initialize it later.
That is not a good design so we change the API to return a complete
struct instead.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/2486
Diffstat (limited to 'vm_insnhelper.c')
-rw-r--r-- | vm_insnhelper.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c index 7db8630f75..0919f6ebe9 100644 --- a/vm_insnhelper.c +++ b/vm_insnhelper.c @@ -19,8 +19,8 @@ #include "ruby/config.h" #include "debug_counter.h" -extern const rb_method_definition_t *rb_method_definition_create(rb_method_type_t type, ID mid); -extern void rb_method_definition_set(const rb_method_entry_t *me, rb_method_definition_t *def, void *opts); +extern const rb_method_definition_t *rb_method_definition_create(rb_method_type_t type, ID mid, const void *opts); +extern void rb_method_definition_set(const rb_method_entry_t *me, const rb_method_definition_t *def); extern int rb_method_definition_eq(const rb_method_definition_t *d1, const rb_method_definition_t *d2); extern VALUE rb_make_no_method_exception(VALUE exc, VALUE format, VALUE obj, int argc, const VALUE *argv, int priv); @@ -2590,8 +2590,8 @@ aliased_callable_method_entry(const rb_callable_method_entry_t *me) } else { const rb_method_definition_t *def = - rb_method_definition_create(VM_METHOD_TYPE_ALIAS, me->def->original_id); - rb_method_definition_set((rb_method_entry_t *)me, (void *)def, (void *)cme); + rb_method_definition_create(VM_METHOD_TYPE_ALIAS, me->def->original_id, cme); + rb_method_definition_set((rb_method_entry_t *)me, def); } } else { |