diff options
author | 卜部昌平 <[email protected]> | 2019-09-25 17:00:25 +0900 |
---|---|---|
committer | 卜部昌平 <[email protected]> | 2019-09-30 10:26:38 +0900 |
commit | 6c6a25feca8752205d81c5247f85d8ae8fb880d8 (patch) | |
tree | 449e41fc35b50b0d498f646303c49935d05b457b /method.h | |
parent | 167e6b48f1b321d671998728adf5a0db06d24445 (diff) |
refactor add rb_method_entry_from_template
Tired of rb_method_entry_create(..., rb_method_definition_create(
..., &(rb_method_foo_t) {...})) maneuver. Provide a function that
does the thing to reduce copy&paste.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/2486
Diffstat (limited to 'method.h')
-rw-r--r-- | method.h | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -185,15 +185,14 @@ STATIC_ASSERT(sizeof_method_def, offsetof(rb_method_definition_t, body)==8); ((def)->type == VM_METHOD_TYPE_REFINED && \ UNDEFINED_METHOD_ENTRY_P((def)->body.refined.orig_me)) -const rb_method_definition_t *rb_method_definition_create(rb_method_type_t which, ID what, const void *how); - void rb_add_method_cfunc(VALUE klass, ID mid, VALUE (*func)(ANYARGS), int argc, rb_method_visibility_t visi); void rb_add_method_iseq(VALUE klass, ID mid, const rb_iseq_t *iseq, rb_cref_t *cref, rb_method_visibility_t visi); void rb_add_refined_method_entry(VALUE refined_class, ID mid); void rb_add_method(VALUE klass, ID mid, rb_method_type_t type, void *option, rb_method_visibility_t visi); rb_method_entry_t *rb_method_entry_set(VALUE klass, ID mid, const rb_method_entry_t *, rb_method_visibility_t noex); -rb_method_entry_t *rb_method_entry_create(ID called_id, VALUE klass, rb_method_visibility_t visi, const rb_method_definition_t *def); +const rb_method_entry_t *rb_method_entry_from_template(const rb_method_entry_t *template, const void *opts); +const rb_method_entry_t *rb_method_entry_for_missing(ID mid, VALUE klass); const rb_method_entry_t *rb_method_entry_at(VALUE obj, ID id); |