Skip to content

Commit 936aec3

Browse files
authored
Ruby 3.2 deprecates double_heap option to GC.verify_compaction_references (#1365)
This commit uses newly supported `expand_heap` option if Ruby version is 3.2 or higher. - Warning message fixed by this commit: ``` $ bundle exec rake spec ... snip ... <internal:gc>:286: warning: double_heap is deprecated, please use expand_heap instead ... snip ... ``` Refer to ruby/ruby@a6dd859
1 parent 43ea8af commit 936aec3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

spec/spec_helper.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@
99
if GC.respond_to?(:verify_compaction_references)
1010
# This method was added in Ruby 3.0.0. Calling it this way asks the GC to
1111
# move objects around, helping to find object movement bugs.
12-
GC.verify_compaction_references(double_heap: true, toward: :empty)
12+
if RUBY_VERSION >= "3.2"
13+
GC.verify_compaction_references(expand_heap: true, toward: :empty)
14+
else
15+
GC.verify_compaction_references(double_heap: true, toward: :empty)
16+
end
1317
end
1418

1519
RSpec.configure do |config|

0 commit comments

Comments
 (0)