aboutsummaryrefslogtreecommitdiffstats
path: root/vm_method.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 /vm_method.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 'vm_method.c')
-rw-r--r--vm_method.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/vm_method.c b/vm_method.c
index 43b5d2aafc..5a8439649a 100644
--- a/vm_method.c
+++ b/vm_method.c
@@ -562,6 +562,7 @@ rb_add_method_iseq(VALUE klass, ID mid, VALUE iseqval, rb_cref_t *cref, rb_metho
iseq_body.iseqptr = iseq;
iseq_body.cref = cref;
rb_add_method(klass, mid, VM_METHOD_TYPE_ISEQ, &iseq_body, visi);
+ RB_GC_GUARD(iseqval);
}
static rb_method_entry_t *