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

ruby-changes:62269

From: nagachika <ko1@a...>
Date: Sun, 19 Jul 2020 11:52:27 +0900 (JST)
Subject: [ruby-changes:62269] e619178e52 (ruby_2_7): merge revision(s) 6e7e7c1e577d6c2276e9a8cc85c28c55c46c2618: [Backport #17023]

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

From e619178e52250ceda3a0fe32ff5addb16617b58c Mon Sep 17 00:00:00 2001
From: nagachika <nagachika@r...>
Date: Sun, 19 Jul 2020 11:52:11 +0900
Subject: merge revision(s) 6e7e7c1e577d6c2276e9a8cc85c28c55c46c2618: [Backport
 #17023]

	Only marked objects should be considered movable

	Ruby's GC is incremental, meaning that during the mark phase (and also
	the sweep phase) programs are allowed to run.  This means that programs
	can allocate objects before the mark or sweep phase have actually
	completed.  Those objects may not have had a chance to be marked, so we
	can't know if they are movable or not. Something that references the
	newly created object might have called the pinning function during the
	mark phase, but since the mark phase hasn't run we can't know if there
	is a "pinning" relationship.

	To be conservative, we must only allow objects that are not pinned but
	also marked to move.

diff --git a/gc.c b/gc.c
index 4700234..a08793f 100644
--- a/gc.c
+++ b/gc.c
@@ -7569,7 +7569,7 @@ gc_is_moveable_obj(rb_objspace_t *objspace, VALUE obj) https://github.com/ruby/ruby/blob/trunk/gc.c#L7569
                 return FALSE;
             }
         }
-        return !RVALUE_PINNED(obj);
+        return RVALUE_MARKED(obj) && !RVALUE_PINNED(obj);
         break;
 
       default:
diff --git a/version.h b/version.h
index c0937dc..eb93496 100644
--- a/version.h
+++ b/version.h
@@ -2,7 +2,7 @@ https://github.com/ruby/ruby/blob/trunk/version.h#L2
 # define RUBY_VERSION_MINOR RUBY_API_VERSION_MINOR
 #define RUBY_VERSION_TEENY 1
 #define RUBY_RELEASE_DATE RUBY_RELEASE_YEAR_STR"-"RUBY_RELEASE_MONTH_STR"-"RUBY_RELEASE_DAY_STR
-#define RUBY_PATCHLEVEL 94
+#define RUBY_PATCHLEVEL 95
 
 #define RUBY_RELEASE_YEAR 2020
 #define RUBY_RELEASE_MONTH 7
-- 
cgit v0.10.2


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

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