Skip to content

Commit

Permalink
Fix test_gc_parameter_init_slots
Browse files Browse the repository at this point in the history
If the stack is not cleared (e.g. compiling with -O0), then `ary` could
remain on the stack, which would be marked. Clear the array first to
make sure all the objects can be GC'd.
  • Loading branch information
peterzhu2118 committed Jul 31, 2023
1 parent 8b390a4 commit 36d669b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions test/ruby/test_gc.rb
Expand Up @@ -438,6 +438,7 @@ def test_gc_parameter_init_slots
while GC.stat_heap(0, :heap_allocatable_pages) != 0
ary << Object.new
end
ary.clear
ary = nil
# Clear all the objects that were allocated.
Expand Down

0 comments on commit 36d669b

Please sign in to comment.