summaryrefslogtreecommitdiff
path: root/array.c
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-02-13 02:04:26 +0000
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-02-13 02:04:26 +0000
commit302ae913e01d2ad9e316c4b003342a58db2ed542 (patch)
tree01088ddf867fe53a885166115a471ab4887ab043 /array.c
parentd6de5804ead57178cffce1af1856af60d2085a31 (diff)
array.c (ary_recycle_hash): use rb_gc_force_recycle
Hidden objects (RBASIC_CLASS(hash) == 0) can never become visible to other threads or signal handlers via ObjectSpace.each_object or similar means. Thus it is safe to forcibly recycle the object slot for future use, here. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57615 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'array.c')
-rw-r--r--array.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/array.c b/array.c
index f170a942ac..e970ca3787 100644
--- a/array.c
+++ b/array.c
@@ -4095,12 +4095,12 @@ ary_make_hash_by(VALUE ary)
static inline void
ary_recycle_hash(VALUE hash)
{
+ assert(RBASIC_CLASS(hash) == 0);
if (RHASH(hash)->ntbl) {
st_table *tbl = RHASH(hash)->ntbl;
- RHASH(hash)->ntbl = 0;
st_free_table(tbl);
}
- RB_GC_GUARD(hash);
+ rb_gc_force_recycle(hash);
}
/*