ruby-changes:21383
From: kosaki <ko1@a...>
Date: Sat, 8 Oct 2011 19:29:55 +0900 (JST)
Subject: [ruby-changes:21383] kosaki:r33432 (ruby_1_9_3): merge revision(s) 33368:
kosaki 2011-10-08 19:26:50 +0900 (Sat, 08 Oct 2011) New Revision: 33432 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=33432 Log: merge revision(s) 33368: * gc.c (add_heap_slots, init_heap): reset heaps_inc zero when heap slots are expanded by environment variable RUBY_HEAP_MIN_SLOTS. [ruby-core:39777] [Bug #5380] * test/ruby/test_gc.rb (test_gc_parameter): add test for it. * test/ruby/envutil.rb (assert_normal_exit): add :child_env option to enable pass environemnt variables to child process. Modified files: branches/ruby_1_9_3/ChangeLog branches/ruby_1_9_3/gc.c branches/ruby_1_9_3/test/ruby/envutil.rb branches/ruby_1_9_3/test/ruby/test_gc.rb Index: ruby_1_9_3/ChangeLog =================================================================== --- ruby_1_9_3/ChangeLog (revision 33431) +++ ruby_1_9_3/ChangeLog (revision 33432) @@ -1,3 +1,14 @@ +Sat Oct 8 06:26:24 2011 CHIKANAGA Tomoyuki <nagachika00@g...> + + * gc.c (add_heap_slots, init_heap): reset heaps_inc zero when + heap slots are expanded by environment variable RUBY_HEAP_MIN_SLOTS. + [ruby-core:39777] [Bug #5380] + + * test/ruby/test_gc.rb (test_gc_parameter): add test for it. + + * test/ruby/envutil.rb (assert_normal_exit): add :child_env option to + enable pass environemnt variables to child process. + Sat Oct 8 05:45:28 2011 Eric Hodel <drbrain@s...> * proc.c (proc_call): Update documentation to match argument handling Index: ruby_1_9_3/gc.c =================================================================== --- ruby_1_9_3/gc.c (revision 33431) +++ ruby_1_9_3/gc.c (revision 33432) @@ -1079,6 +1079,7 @@ for (i = 0; i < add; i++) { assign_heap_slot(objspace); } + heaps_inc = 0; } static void @@ -1095,7 +1096,6 @@ } #endif - heaps_inc = 0; objspace->profile.invoke_time = getrusage_time(); finalizer_table = st_init_numtable(); } Index: ruby_1_9_3/test/ruby/test_gc.rb =================================================================== --- ruby_1_9_3/test/ruby/test_gc.rb (revision 33431) +++ ruby_1_9_3/test/ruby/test_gc.rb (revision 33432) @@ -1,5 +1,7 @@ require 'test/unit' +require_relative "envutil" + class TestGc < Test::Unit::TestCase class S def initialize(a) @@ -78,4 +80,12 @@ ensure GC.stress = prev_stress end + + def test_gc_parameter + env = { + "RUBY_GC_MALLOC_LIMIT" => "60000000", + "RUBY_HEAP_MIN_SLOTS" => "100000" + } + assert_normal_exit("1", "[ruby-core:39777]", :child_env => env) + end end Index: ruby_1_9_3/test/ruby/envutil.rb =================================================================== --- ruby_1_9_3/test/ruby/envutil.rb (revision 33431) +++ ruby_1_9_3/test/ruby/envutil.rb (revision 33432) @@ -122,7 +122,13 @@ module Assertions public def assert_normal_exit(testsrc, message = '', opt = {}) - out, _, status = EnvUtil.invoke_ruby(%W'-W0', testsrc, true, :merge_to_stdout, opt) + if opt.include?(:child_env) + opt = opt.dup + child_env = [opt.delete(:child_env)] || [] + else + child_env = [] + end + out, _, status = EnvUtil.invoke_ruby(child_env + %W'-W0', testsrc, true, :merge_to_stdout, opt) pid = status.pid faildesc = proc do signo = status.termsig -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/