summaryrefslogtreecommitdiff
path: root/class.c
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-06-30 21:07:18 (GMT)
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-06-30 21:07:18 (GMT)
commitb49075cdf15a733cf7a9b1f9ce9d06c40828db3d (patch)
treeffe20a1e7d680301a086083bd3ee77b081eba29d /class.c
parentc7548028a20c555b692c07c37b3ffd2d416bb434 (diff)
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 6ee1e08..6207fb7 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));