path: root/iseq.c
diff options
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
commitb49075cdf15a733cf7a9b1f9ce9d06c40828db3d (patch)
treeffe20a1e7d680301a086083bd3ee77b081eba29d /iseq.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:// b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'iseq.c')
1 files changed, 2 insertions, 0 deletions
diff --git a/iseq.c b/iseq.c
index 037df44..48de119 100644
--- a/iseq.c
+++ b/iseq.c
@@ -1968,6 +1968,8 @@ rb_iseq_clone(VALUE iseqval, VALUE newcbase)
RB_OBJ_WRITTEN(iseq1->self, Qundef, iseq1->klass);
+ RB_GC_GUARD(iseqval); /* seems necessary iff RGenGC is disabled */
return newiseq;