aboutsummaryrefslogtreecommitdiffstats
path: root/method.h
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-08-28 02:45:41 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-08-28 02:45:41 +0000
commitfcf88c1b8df49ba0c4db026f2b17066ea66d3de2 (patch)
tree7ecf3bf8229b0b8bad34356db259917894d4526c /method.h
parenta2f378737fc70cdfce65a3d08eda1c9a99d89b4d (diff)
downloadruby-fcf88c1b8df49ba0c4db026f2b17066ea66d3de2.tar.gz
* 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
Diffstat (limited to 'method.h')
-rw-r--r--method.h17
1 files changed, 12 insertions, 5 deletions
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 */