File tree Expand file tree Collapse file tree 2 files changed +17
-15
lines changed Expand file tree Collapse file tree 2 files changed +17
-15
lines changed Original file line number Diff line number Diff line change 50
50
51
51
- run : rake compile
52
52
53
- - run : rake test
53
+ - run : rake test JSON_COMPACT=1
54
54
55
55
- run : rake build
56
56
78
78
79
79
- run : rake compile
80
80
81
- - run : rake valgrind
81
+ - run : rake valgrind JSON_COMPACT=1
Original file line number Diff line number Diff line change 3
3
require 'json'
4
4
require 'test/unit'
5
5
6
- if GC . respond_to? ( :verify_compaction_references )
7
- # This method was added in Ruby 3.0.0. Calling it this way asks the GC to
8
- # move objects around, helping to find object movement bugs.
9
- begin
10
- GC . verify_compaction_references ( expand_heap : true , toward : :empty )
11
- rescue NotImplementedError , ArgumentError
12
- # Some platforms don't support compaction
6
+ if ENV [ "JSON_COMPACT" ]
7
+ if GC . respond_to? ( :verify_compaction_references )
8
+ # This method was added in Ruby 3.0.0. Calling it this way asks the GC to
9
+ # move objects around, helping to find object movement bugs.
10
+ begin
11
+ GC . verify_compaction_references ( expand_heap : true , toward : :empty )
12
+ rescue NotImplementedError , ArgumentError
13
+ # Some platforms don't support compaction
14
+ end
13
15
end
14
- end
15
16
16
- if GC . respond_to? ( :auto_compact= )
17
- begin
18
- GC . auto_compact = true
19
- rescue NotImplementedError
20
- # Some platforms don't support compaction
17
+ if GC . respond_to? ( :auto_compact= )
18
+ begin
19
+ GC . auto_compact = true
20
+ rescue NotImplementedError
21
+ # Some platforms don't support compaction
22
+ end
21
23
end
22
24
end
23
25
You can’t perform that action at this time.
0 commit comments