mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* 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
This commit is contained in:
parent
a2f378737f
commit
fcf88c1b8d
11 changed files with 233 additions and 193 deletions
17
method.h
17
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 */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue