Skip to content

Commit

Permalink
Appease ruby/ruby CI
Browse files Browse the repository at this point in the history
  • Loading branch information
byroot committed Nov 5, 2024
1 parent e851071 commit bc2c970
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
- run: rake compile

- run: rake test
- run: rake test JSON_COMPACT=1

- run: rake build

Expand Down Expand Up @@ -78,4 +78,4 @@ jobs:
- run: rake compile

- run: rake valgrind
- run: rake valgrind JSON_COMPACT=1
28 changes: 15 additions & 13 deletions test/json/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,23 @@
require 'json'
require 'test/unit'

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(expand_heap: true, toward: :empty)
rescue NotImplementedError, ArgumentError
# Some platforms don't support compaction
if ENV["JSON_COMPACT"]
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(expand_heap: true, toward: :empty)
rescue NotImplementedError, ArgumentError
# Some platforms don't support compaction
end
end
end

if GC.respond_to?(:auto_compact=)
begin
GC.auto_compact = true
rescue NotImplementedError
# Some platforms don't support compaction
if GC.respond_to?(:auto_compact=)
begin
GC.auto_compact = true
rescue NotImplementedError
# Some platforms don't support compaction
end
end
end

Expand Down

0 comments on commit bc2c970

Please sign in to comment.