[前][次][番号順一覧][スレッド一覧]

ruby-changes:72634

From: Peter <ko1@a...>
Date: Fri, 22 Jul 2022 04:18:23 +0900 (JST)
Subject: [ruby-changes:72634] 9d862011e8 (master): Remove check for shared root arrays

https://git.ruby-lang.org/ruby.git/commit/?id=9d862011e8

From 9d862011e82b04bf21b26ebe4b472e8ef801dfef Mon Sep 17 00:00:00 2001
From: Peter Zhu <peter@p...>
Date: Thu, 21 Jul 2022 15:16:06 -0400
Subject: Remove check for shared root arrays

All shared root arrays should not be on the transient heap.
ary_make_shared evacuates arrays from the transient heap when creating
shared roots.
---
 array.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/array.c b/array.c
index 54d928a992..c0b49340c6 100644
--- a/array.c
+++ b/array.c
@@ -452,15 +452,13 @@ static inline void https://github.com/ruby/ruby/blob/trunk/array.c#L452
 rb_ary_transient_heap_evacuate_(VALUE ary, int transient, int promote)
 {
     if (transient) {
+        assert(!ARY_SHARED_ROOT_P(ary));
+
         VALUE *new_ptr;
         const VALUE *old_ptr = ARY_HEAP_PTR(ary);
         long capa = ARY_HEAP_CAPA(ary);
         long len  = ARY_HEAP_LEN(ary);
 
-        if (ARY_SHARED_ROOT_P(ary)) {
-            capa = len;
-        }
-
         assert(ARY_OWNS_HEAP_P(ary));
         assert(RARRAY_TRANSIENT_P(ary));
         assert(!ARY_PTR_USING_P(ary));
-- 
cgit v1.2.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]