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

ruby-changes:60279

From: Koichi <ko1@a...>
Date: Wed, 4 Mar 2020 11:35:45 +0900 (JST)
Subject: [ruby-changes:60279] 6e271e4cbb (master): Run major GC to make sure the minor GC next time.

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

From 6e271e4cbbe6a8bc4d4f75dc553ce054eae7af00 Mon Sep 17 00:00:00 2001
From: Koichi Sasada <ko1@a...>
Date: Wed, 4 Mar 2020 11:31:07 +0900
Subject: Run major GC to make sure the minor GC next time.

`GC.start(full_mark: false)` can run full GC because of last
GC status. Just after major GC, the possibility to run major GC
next time is too small (not a zero, but too small possibility).

diff --git a/test/ruby/test_gc.rb b/test/ruby/test_gc.rb
index 77f5d8c..401af99 100644
--- a/test/ruby/test_gc.rb
+++ b/test/ruby/test_gc.rb
@@ -56,8 +56,9 @@ class TestGc < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_gc.rb#L56
     return unless use_rgengc?
     skip 'stress' if GC.stress
 
+    GC.start # full mark and next time it should be minor mark
     GC.start(full_mark: false)
-    assert_nil GC.latest_gc_info(:major_by)
+    assert_nil GC.latest_gc_info(:major_by, msg)
 
     GC.start(full_mark: true)
     assert_not_nil GC.latest_gc_info(:major_by)
-- 
cgit v0.10.2


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

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