diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-08-28 02:45:41 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-08-28 02:45:41 +0000 |
commit | fcf88c1b8df49ba0c4db026f2b17066ea66d3de2 (patch) | |
tree | 7ecf3bf8229b0b8bad34356db259917894d4526c /gc.c | |
parent | a2f378737fc70cdfce65a3d08eda1c9a99d89b4d (diff) |
* 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 'gc.c')
-rw-r--r-- | gc.c | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -1377,13 +1377,16 @@ rb_mark_hash(st_table *tbl) static void mark_method_entry(rb_objspace_t *objspace, const rb_method_entry_t *me, int lev) { + const rb_method_definition_t *def = me->def; + gc_mark(objspace, me->klass, lev); - switch (me->type) { + if (!def) return; + switch (def->type) { case VM_METHOD_TYPE_ISEQ: - gc_mark(objspace, me->body.iseq->self, lev); + gc_mark(objspace, def->body.iseq->self, lev); break; case VM_METHOD_TYPE_BMETHOD: - gc_mark(objspace, me->body.proc, lev); + gc_mark(objspace, def->body.proc, lev); break; default: break; /* ignore */ @@ -1417,7 +1420,7 @@ mark_m_tbl(rb_objspace_t *objspace, st_table *tbl, int lev) static int free_method_entry_i(ID key, rb_method_entry_t *me, st_data_t data) { - xfree(me); + rb_free_method_entry(me); return ST_CONTINUE; } |