From 990d709eeb04640f1909ba23ec81031c75408bac Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 4 Apr 2016 14:37:07 +0000 Subject: at_exit list * 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/trunk@54484 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/-ext-/vm/test_at_exit.rb | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 test/-ext-/vm/test_at_exit.rb (limited to 'test/-ext-') diff --git a/test/-ext-/vm/test_at_exit.rb b/test/-ext-/vm/test_at_exit.rb new file mode 100644 index 0000000000..61ad831792 --- /dev/null +++ b/test/-ext-/vm/test_at_exit.rb @@ -0,0 +1,19 @@ +# 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 + -- cgit v1.2.3