aboutsummaryrefslogtreecommitdiffstats
path: root/class.c
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-06-30 21:07:18 +0000
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-06-30 21:07:18 +0000
commit5f815cacee3aef50e984d31282f50464f18fb59b (patch)
treeffe20a1e7d680301a086083bd3ee77b081eba29d /class.c
parent0c68f28ea4d2224952d9e7721837be9e37c08e32 (diff)
downloadruby-5f815cacee3aef50e984d31282f50464f18fb59b.tar.gz
move RB_GC_GUARD responsibility to rb_add_method_iseq
This simplifies all the callers and makes code easier to use and review. I was confused about the need for RB_GC_GUARD in define_{aset,aref}_method of struct.c without reading rb_add_method_iseq. Likewise, do the same for rb_iseq_clone, where the GC guard only seems neccesary iff RGenGC is disabled. * vm_method.c (rb_add_method_iseq): add RB_GC_GUARD * class.c (clone_method): remove RB_GC_GUARD * struct.c (define_aref_method): ditto (define_aset_method): ditto * vm.c (vm_define_method): * iseq.c (rb_iseq_clone): add RB_GC_GUARD git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51079 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'class.c')
-rw-r--r--class.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/class.c b/class.c
index 6ee1e084d3..6207fb7c5a 100644
--- a/class.c
+++ b/class.c
@@ -249,7 +249,6 @@ clone_method(VALUE old_klass, VALUE new_klass, ID mid, const rb_method_entry_t *
newiseqval = rb_iseq_clone(me->def->body.iseq.iseqptr->self, new_klass);
rb_vm_rewrite_cref(me->def->body.iseq.cref, old_klass, new_klass, &new_cref);
rb_add_method_iseq(new_klass, mid, newiseqval, new_cref, METHOD_ENTRY_VISI(me));
- RB_GC_GUARD(newiseqval);
}
else {
rb_method_entry_set(new_klass, mid, me, METHOD_ENTRY_VISI(me));