diff options
Diffstat (limited to 'test/fiddle/helper.rb')
-rw-r--r-- | test/fiddle/helper.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/fiddle/helper.rb b/test/fiddle/helper.rb index f7143f2422..0ea3bf57f4 100644 --- a/test/fiddle/helper.rb +++ b/test/fiddle/helper.rb @@ -1,4 +1,6 @@ # frozen_string_literal: true + +require 'rbconfig/sizeof' require 'test/unit' require 'fiddle' @@ -165,5 +167,12 @@ module Fiddle GC.start end end + + def under_gc_stress + stress, GC.stress = GC.stress, true + yield + ensure + GC.stress = stress + end end end |