path: root/enum.c
diff options
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-12-03 12:36:39 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-12-03 12:36:39 +0000
commit5e11de658511efd346ed8bb0fac8a49e7c0eb963 (patch)
tree2e62e61d46462125ce7c2712a0cb6f0acbea30ba /enum.c
parent60989daa1b1960468933a2ab85352d95829c329e (diff)
make `RARRAY_PTR_USE` more conservertive.
* include/ruby/ruby.h: de-transient at `RARRAY_PTR_USE` and `RARRAY_PTR_USE_START`. Introduce `RARRAY_PTR_USE_TRANSIENT` and `RARRAY_PTR_USE_START_TRANSIENT` if you don't want to de-transient an array. Generally, it is difficult so C-extension writers should not use them. * array.c: use `RARRAY_PTR_USE_TRANSIENT` if possible. * hash.c: ditto. * enum.c (enum_sort_by): remove `rb_ary_transient_heap_evacuate()` because `RARRAY_PTR_USE` do de-transient. git-svn-id: svn+ssh:// b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'enum.c')
1 files changed, 0 insertions, 1 deletions
diff --git a/enum.c b/enum.c
index 3be6941..4c10078 100644
--- a/enum.c
+++ b/enum.c
@@ -1172,7 +1172,6 @@ enum_sort_by(VALUE obj)
rb_ary_concat(ary, buf);
if (RARRAY_LEN(ary) > 2) {
- rb_ary_transient_heap_evacuate(ary, TRUE); /* should be malloc heap */
RARRAY_PTR_USE(ary, ptr,
ruby_qsort(ptr, RARRAY_LEN(ary)/2, 2*sizeof(VALUE),
sort_by_cmp, (void *)ary));