Skip to content

Commit

Permalink
Merge pull request #367 from syngenta/fix/use-expand-heap-for-ruby-3-2-0
Browse files Browse the repository at this point in the history
fix: use expand_heap for Ruby 3.2.0+
  • Loading branch information
keithdoggett committed Dec 4, 2023
2 parents 9829ded + 0fc7374 commit f7f1451
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@ def geos_version_match(requirement)
# Static test for missed references in our CAPI codebase (or FFI interface).
# See https://alanwu.space/post/check-compaction/
if defined?(GC.verify_compaction_references) == "method"
GC.verify_compaction_references(double_heap: true, toward: :empty)
if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("3.2.0")
GC.verify_compaction_references(expand_heap: true, toward: :empty)
else
GC.verify_compaction_references(double_heap: true, toward: :empty)
end
end

# Live test for our implementation of Ruby's compaction methods (rb_gc_mark_movable
Expand Down

0 comments on commit f7f1451

Please sign in to comment.