ruby-changes:21384
From: kosaki <ko1@a...>
Date: Sat, 8 Oct 2011 19:37:35 +0900 (JST)
Subject: [ruby-changes:21384] kosaki:r33433 (ruby_1_9_3): merge revision(s) 33379:
kosaki 2011-10-08 19:37:23 +0900 (Sat, 08 Oct 2011) New Revision: 33433 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=33433 Log: merge revision(s) 33379: * gc.c (rb_gc_set_params): output GC parameter change messages only if -w/-v options are specified. these messages are output to stderr, not to stdout. [ruby-core:39795] [Bug #5380] * test/ruby/test_gc.rb (test_gc_parameter): add test for it. Modified files: branches/ruby_1_9_3/ChangeLog branches/ruby_1_9_3/gc.c branches/ruby_1_9_3/test/ruby/test_gc.rb Index: ruby_1_9_3/ChangeLog =================================================================== --- ruby_1_9_3/ChangeLog (revision 33432) +++ ruby_1_9_3/ChangeLog (revision 33433) @@ -1,3 +1,11 @@ +Sat Oct 8 06:37:08 2011 CHIKANAGA Tomoyuki <nagachika00@g...> + + * gc.c (rb_gc_set_params): output GC parameter change messages only + if -w/-v options are specified. these messages are output to stderr, + not to stdout. [ruby-core:39795] [Bug #5380] + + * test/ruby/test_gc.rb (test_gc_parameter): add test for it. + Sat Oct 8 06:26:24 2011 CHIKANAGA Tomoyuki <nagachika00@g...> * gc.c (add_heap_slots, init_heap): reset heaps_inc zero when Index: ruby_1_9_3/gc.c =================================================================== --- ruby_1_9_3/gc.c (revision 33432) +++ ruby_1_9_3/gc.c (revision 33433) @@ -416,7 +416,9 @@ malloc_limit_ptr = getenv("RUBY_GC_MALLOC_LIMIT"); if (malloc_limit_ptr != NULL) { int malloc_limit_i = atoi(malloc_limit_ptr); - printf("malloc_limit=%d (%d)\n", malloc_limit_i, initial_malloc_limit); + if (ruby_verbose) + fprintf(stderr, "malloc_limit=%d (%d)\n", + malloc_limit_i, initial_malloc_limit); if (malloc_limit_i > 0) { initial_malloc_limit = malloc_limit_i; } @@ -425,7 +427,9 @@ heap_min_slots_ptr = getenv("RUBY_HEAP_MIN_SLOTS"); if (heap_min_slots_ptr != NULL) { int heap_min_slots_i = atoi(heap_min_slots_ptr); - printf("heap_min_slots=%d (%d)\n", heap_min_slots_i, initial_heap_min_slots); + if (ruby_verbose) + fprintf(stderr, "heap_min_slots=%d (%d)\n", + heap_min_slots_i, initial_heap_min_slots); if (heap_min_slots_i > 0) { initial_heap_min_slots = heap_min_slots_i; initial_expand_heap(&rb_objspace); @@ -435,7 +439,8 @@ free_min_ptr = getenv("RUBY_FREE_MIN"); if (free_min_ptr != NULL) { int free_min_i = atoi(free_min_ptr); - printf("free_min=%d (%d)\n", free_min_i, initial_free_min); + if (ruby_verbose) + fprintf(stderr, "free_min=%d (%d)\n", free_min_i, initial_free_min); if (free_min_i > 0) { initial_free_min = free_min_i; } Index: ruby_1_9_3/test/ruby/test_gc.rb =================================================================== --- ruby_1_9_3/test/ruby/test_gc.rb (revision 33432) +++ ruby_1_9_3/test/ruby/test_gc.rb (revision 33433) @@ -86,6 +86,12 @@ "RUBY_GC_MALLOC_LIMIT" => "60000000", "RUBY_HEAP_MIN_SLOTS" => "100000" } - assert_normal_exit("1", "[ruby-core:39777]", :child_env => env) + assert_normal_exit("exit", "[ruby-core:39777]", :child_env => env) + + env = { + "RUBY_HEAP_MIN_SLOTS" => "100000" + } + assert_in_out_err([env, "-e", "exit"], "", [], [], "[ruby-core:39795]") + assert_in_out_err([env, "-w", "-e", "exit"], "", [], /heap_min_slots=100000/, "[ruby-core:39795]") end end -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/