From 5e11de658511efd346ed8bb0fac8a49e7c0eb963 Mon Sep 17 00:00:00 2001 From: ko1 Date: Mon, 3 Dec 2018 12:36:39 +0000 Subject: 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://ci.ruby-lang.org/ruby/trunk@66165 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- enum.c | 1 - 1 file changed, 1 deletion(-) (limited to 'enum.c') diff --git a/enum.c b/enum.c index 3be6941c3a..4c10078509 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)); -- cgit v1.2.3