ruby/test/-ext-/vm/test_at_exit.rb
naruse 157401a9a1 merge revision(s) 54484: [Backport #12095]
* vm_core.h (rb_vm_struct): make at_exit a single linked list but
	  not RArray, not to mark the registered functions by the write
	  barrier.  based on the patches by Evan Phoenix.
	  [ruby-core:73908] [Bug #12095]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_3@54633 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-18 08:15:33 +00:00

19 lines
393 B
Ruby

# frozen_string_literal: false
class TestVM < Test::Unit::TestCase
# [Bug #12095]
def test_at_exit
assert_in_out_err([], <<-"end;", %w[begin end]) # do
require '-test-/vm/at_exit'
Bug::VM.register_at_exit(false)
1000.times do
Bug::VM.register_at_exit(nil)
["x"]*1000
end
GC.start
Bug::VM.register_at_exit(true)
end;
end
end