1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
# frozen_string_literal: true
require "minitest/autorun"
require "liquid/c"
if GC.respond_to?(:verify_compaction_references)
# This method was added in Ruby 3.0.0. Calling it this way asks the GC to
# move objects around, helping to find object movement bugs.
begin
GC.verify_compaction_references(double_heap: true, toward: :empty)
# Enable auto-compaction in the GC if supported.
if GC.respond_to?(:auto_compact=)
GC.auto_compact = true
end
rescue NotImplementedError
puts "W: GC compaction not suppported by platform"
end
end
GC.stress = true if ENV["GC_STRESS"]
|