From 595b3c4fddc5cde58add2fa2637acb2664694194 Mon Sep 17 00:00:00 2001 From: 卜部昌平 Date: Mon, 23 Sep 2019 17:42:27 +0900 Subject: 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. --- vm_insnhelper.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'vm_insnhelper.c') 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 { -- cgit v1.2.3