gc_parameter_message.patch

Tomoyuki Chikanaga, 10/01/2011 11:22 AM

Download (2.06 KB)

View differences:

gc.c
427 427
    malloc_limit_ptr = getenv("RUBY_GC_MALLOC_LIMIT");
428 428
    if (malloc_limit_ptr != NULL) {
429 429
	int malloc_limit_i = atoi(malloc_limit_ptr);
430
	printf("malloc_limit=%d (%d)\n", malloc_limit_i, initial_malloc_limit);
430
	if (ruby_verbose)
431
	    fprintf(stderr, "malloc_limit=%d (%d)\n",
432
		    malloc_limit_i, initial_malloc_limit);
431 433
	if (malloc_limit_i > 0) {
432 434
	    initial_malloc_limit = malloc_limit_i;
433 435
	}
......
436 438
    heap_min_slots_ptr = getenv("RUBY_HEAP_MIN_SLOTS");
437 439
    if (heap_min_slots_ptr != NULL) {
438 440
	int heap_min_slots_i = atoi(heap_min_slots_ptr);
439
	printf("heap_min_slots=%d (%d)\n", heap_min_slots_i, initial_heap_min_slots);
441
	if (ruby_verbose)
442
	    fprintf(stderr, "heap_min_slots=%d (%d)\n",
443
		    heap_min_slots_i, initial_heap_min_slots);
440 444
	if (heap_min_slots_i > 0) {
441 445
	    initial_heap_min_slots = heap_min_slots_i;
442 446
            initial_expand_heap(&rb_objspace);
......
446 450
    free_min_ptr = getenv("RUBY_FREE_MIN");
447 451
    if (free_min_ptr != NULL) {
448 452
	int free_min_i = atoi(free_min_ptr);
449
	printf("free_min=%d (%d)\n", free_min_i, initial_free_min);
453
	if (ruby_verbose)
454
	    fprintf(stderr, "free_min=%d (%d)\n", free_min_i, initial_free_min);
450 455
	if (free_min_i > 0) {
451 456
	    initial_free_min = free_min_i;
452 457
	}
test/ruby/test_gc.rb
86 86
      "RUBY_GC_MALLOC_LIMIT" => "60000000",
87 87
      "RUBY_HEAP_MIN_SLOTS" => "100000"
88 88
    }
89
    assert_normal_exit("1", "[ruby-core:39777]", :child_env => env)
89
    assert_normal_exit("exit", "[ruby-core:39777]", :child_env => env)
90

  
91
    env = {
92
      "RUBY_HEAP_MIN_SLOTS" => "100000"
93
    }
94
    assert_in_out_err([env, "-e", "exit"], "", [], [], "[ruby-core:39795]")
95
    assert_in_out_err([env, "-w", "-e", "exit"], "", [], /heap_min_slots=100000/, "[ruby-core:39795]")
90 96
  end
91 97
end