[ruby/json] Appease ruby/ruby CI
https://github.com/ruby/json/commit/bc2c970ce4
This commit is contained in:
parent
633f65e471
commit
4120f2babd
Notes:
git
2024-11-05 17:00:56 +00:00
@ -3,21 +3,23 @@ $LOAD_PATH.unshift(File.expand_path('../../../ext', __FILE__), File.expand_path(
|
|||||||
require 'json'
|
require 'json'
|
||||||
require 'test/unit'
|
require 'test/unit'
|
||||||
|
|
||||||
if GC.respond_to?(:verify_compaction_references)
|
if ENV["JSON_COMPACT"]
|
||||||
# This method was added in Ruby 3.0.0. Calling it this way asks the GC to
|
if GC.respond_to?(:verify_compaction_references)
|
||||||
# move objects around, helping to find object movement bugs.
|
# This method was added in Ruby 3.0.0. Calling it this way asks the GC to
|
||||||
begin
|
# move objects around, helping to find object movement bugs.
|
||||||
GC.verify_compaction_references(expand_heap: true, toward: :empty)
|
begin
|
||||||
rescue NotImplementedError, ArgumentError
|
GC.verify_compaction_references(expand_heap: true, toward: :empty)
|
||||||
# Some platforms don't support compaction
|
rescue NotImplementedError, ArgumentError
|
||||||
|
# Some platforms don't support compaction
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
if GC.respond_to?(:auto_compact=)
|
if GC.respond_to?(:auto_compact=)
|
||||||
begin
|
begin
|
||||||
GC.auto_compact = true
|
GC.auto_compact = true
|
||||||
rescue NotImplementedError
|
rescue NotImplementedError
|
||||||
# Some platforms don't support compaction
|
# Some platforms don't support compaction
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user