ruby-changes:65720
From: Nobuyoshi <ko1@a...>
Date: Wed, 31 Mar 2021 22:14:44 +0900 (JST)
Subject: [ruby-changes:65720] 2a02b61fae (master): Use EnvUtil.under_gc_stress
https://git.ruby-lang.org/ruby.git/commit/?id=2a02b61fae From 2a02b61fae2c5dcfaf123f43c08c7c7949c1790c Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Wed, 31 Mar 2021 22:14:15 +0900 Subject: Use EnvUtil.under_gc_stress --- test/objspace/test_objspace.rb | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/test/objspace/test_objspace.rb b/test/objspace/test_objspace.rb index 1ccee02..97f3d60 100644 --- a/test/objspace/test_objspace.rb +++ b/test/objspace/test_objspace.rb @@ -244,16 +244,12 @@ class TestObjSpace < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/objspace/test_objspace.rb#L244 end def test_trace_object_allocations_gc_stress - prev = GC.stress - GC.stress = true - - ObjectSpace.trace_object_allocations{ - proc{} - } - + EnvUtil.under_gc_stress do + ObjectSpace.trace_object_allocations{ + proc{} + } + end assert true # success - ensure - GC.stress = prev end def test_dump_flags -- cgit v1.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/