From fcf88c1b8df49ba0c4db026f2b17066ea66d3de2 Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 28 Aug 2009 02:45:41 +0000 Subject: * method.h (rb_method_definition_t): split from rb_method_entry_t to deal aliases. [ruby-dev:39165] * proc.c (struct METHOD): contains rb_method_entry_t copy. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- method.h | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'method.h') diff --git a/method.h b/method.h index 0185c059b5..e6d4fab8b3 100644 --- a/method.h +++ b/method.h @@ -49,12 +49,9 @@ typedef struct rb_method_cfunc_struct { typedef struct rb_iseq_struct rb_iseq_t; -typedef struct rb_method_entry_struct { - rb_method_flag_t flag; +typedef struct rb_method_definition_struct { rb_method_type_t type; /* method type */ - ID called_id; ID original_id; - VALUE klass; /* should be mark */ union { rb_iseq_t *iseq; /* should be mark */ rb_method_cfunc_t cfunc; @@ -66,13 +63,23 @@ typedef struct rb_method_entry_struct { } optimize_type; } body; int alias_count; +} rb_method_definition_t; + +typedef struct rb_method_entry_struct { + rb_method_flag_t flag; + rb_method_definition_t *def; + ID called_id; + VALUE klass; /* should be mark */ } rb_method_entry_t; +#define UNDEFINED_METHOD_ENTRY_P(me) (!(me) || !(me)->def || (me)->def->type == VM_METHOD_TYPE_UNDEF) + void rb_add_method_cfunc(VALUE klass, ID mid, VALUE (*func)(ANYARGS), int argc, rb_method_flag_t noex); rb_method_entry_t *rb_add_method(VALUE klass, ID mid, rb_method_type_t type, void *option, rb_method_flag_t noex); -void rb_add_method_me(VALUE klass, ID mid, const rb_method_entry_t *, rb_method_flag_t noex); +rb_method_entry_t *rb_add_method_me(VALUE klass, ID mid, const rb_method_entry_t *, rb_method_flag_t noex); rb_method_entry_t *rb_method_entry(VALUE klass, ID id); int rb_method_entry_arity(const rb_method_entry_t *me); void rb_gc_mark_method_entry(const rb_method_entry_t *me); +void rb_free_method_entry(rb_method_entry_t *me); #endif /* METHOD_H */ -- cgit v1.2.3