mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* gc.c (rb_gc_set_params): ruby_verbose can be Qnil, so use RTEST.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33395 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
f65cdf797f
commit
356c7cbfb6
3 changed files with 9 additions and 3 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
Tue Oct 4 11:44:10 2011 NARUSE, Yui <naruse@ruby-lang.org>
|
||||||
|
|
||||||
|
* gc.c (rb_gc_set_params): ruby_verbose can be Qnil, so use RTEST.
|
||||||
|
|
||||||
Tue Oct 4 08:33:41 2011 Eric Hodel <drbrain@segment7.net>
|
Tue Oct 4 08:33:41 2011 Eric Hodel <drbrain@segment7.net>
|
||||||
|
|
||||||
* ext/etc/etc.c: Document Etc, Etc.sysconfdir, Etc.systmpdir. Patch
|
* ext/etc/etc.c: Document Etc, Etc.sysconfdir, Etc.systmpdir. Patch
|
||||||
|
|
6
gc.c
6
gc.c
|
@ -427,7 +427,7 @@ rb_gc_set_params(void)
|
||||||
malloc_limit_ptr = getenv("RUBY_GC_MALLOC_LIMIT");
|
malloc_limit_ptr = getenv("RUBY_GC_MALLOC_LIMIT");
|
||||||
if (malloc_limit_ptr != NULL) {
|
if (malloc_limit_ptr != NULL) {
|
||||||
int malloc_limit_i = atoi(malloc_limit_ptr);
|
int malloc_limit_i = atoi(malloc_limit_ptr);
|
||||||
if (ruby_verbose)
|
if (RTEST(ruby_verbose))
|
||||||
fprintf(stderr, "malloc_limit=%d (%d)\n",
|
fprintf(stderr, "malloc_limit=%d (%d)\n",
|
||||||
malloc_limit_i, initial_malloc_limit);
|
malloc_limit_i, initial_malloc_limit);
|
||||||
if (malloc_limit_i > 0) {
|
if (malloc_limit_i > 0) {
|
||||||
|
@ -438,7 +438,7 @@ rb_gc_set_params(void)
|
||||||
heap_min_slots_ptr = getenv("RUBY_HEAP_MIN_SLOTS");
|
heap_min_slots_ptr = getenv("RUBY_HEAP_MIN_SLOTS");
|
||||||
if (heap_min_slots_ptr != NULL) {
|
if (heap_min_slots_ptr != NULL) {
|
||||||
int heap_min_slots_i = atoi(heap_min_slots_ptr);
|
int heap_min_slots_i = atoi(heap_min_slots_ptr);
|
||||||
if (ruby_verbose)
|
if (RTEST(ruby_verbose))
|
||||||
fprintf(stderr, "heap_min_slots=%d (%d)\n",
|
fprintf(stderr, "heap_min_slots=%d (%d)\n",
|
||||||
heap_min_slots_i, initial_heap_min_slots);
|
heap_min_slots_i, initial_heap_min_slots);
|
||||||
if (heap_min_slots_i > 0) {
|
if (heap_min_slots_i > 0) {
|
||||||
|
@ -450,7 +450,7 @@ rb_gc_set_params(void)
|
||||||
free_min_ptr = getenv("RUBY_FREE_MIN");
|
free_min_ptr = getenv("RUBY_FREE_MIN");
|
||||||
if (free_min_ptr != NULL) {
|
if (free_min_ptr != NULL) {
|
||||||
int free_min_i = atoi(free_min_ptr);
|
int free_min_i = atoi(free_min_ptr);
|
||||||
if (ruby_verbose)
|
if (RTEST(ruby_verbose))
|
||||||
fprintf(stderr, "free_min=%d (%d)\n", free_min_i, initial_free_min);
|
fprintf(stderr, "free_min=%d (%d)\n", free_min_i, initial_free_min);
|
||||||
if (free_min_i > 0) {
|
if (free_min_i > 0) {
|
||||||
initial_free_min = free_min_i;
|
initial_free_min = free_min_i;
|
||||||
|
|
|
@ -93,6 +93,8 @@ class TestGc < Test::Unit::TestCase
|
||||||
"RUBY_HEAP_MIN_SLOTS" => "100000"
|
"RUBY_HEAP_MIN_SLOTS" => "100000"
|
||||||
}
|
}
|
||||||
assert_in_out_err([env, "-e", "exit"], "", [], [], "[ruby-core:39795]")
|
assert_in_out_err([env, "-e", "exit"], "", [], [], "[ruby-core:39795]")
|
||||||
|
assert_in_out_err([env, "-W0", "-e", "exit"], "", [], [], "[ruby-core:39795]")
|
||||||
|
assert_in_out_err([env, "-W1", "-e", "exit"], "", [], [], "[ruby-core:39795]")
|
||||||
assert_in_out_err([env, "-w", "-e", "exit"], "", [], /heap_min_slots=100000/, "[ruby-core:39795]")
|
assert_in_out_err([env, "-w", "-e", "exit"], "", [], /heap_min_slots=100000/, "[ruby-core:39795]")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue