Skip to content

Commit 32a7d17

Browse files
ko1tmm1
authored andcommitted
* gc.c (ruby_gc_set_params): don't show obsolete warnings for
RUBY_FREE_MIN/RUBY_HEAP_MIN_SLOTS if RUBY_GC_HEAP_FREE_SLOTS/RUBY_GC_HEAP_INIT_SLOTS are given. [Bug ruby#9276] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44327 b2dd03c8-39d4-4d8f-98ff-823fe69b080e Conflicts: ChangeLog
1 parent 3c27e63 commit 32a7d17

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

gc.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5764,17 +5764,19 @@ ruby_gc_set_params(int safe_level)
57645764
if (safe_level > 0) return;
57655765

57665766
/* RUBY_GC_HEAP_FREE_SLOTS */
5767-
if (get_envparam_int ("RUBY_FREE_MIN", &gc_params.heap_free_slots, 0)) {
5767+
if (get_envparam_int("RUBY_GC_HEAP_FREE_SLOTS", &gc_params.heap_free_slots, 0)) {
5768+
/* ok */
5769+
}
5770+
else if (get_envparam_int("RUBY_FREE_MIN", &gc_params.heap_free_slots, 0)) {
57685771
rb_warn("RUBY_FREE_MIN is obsolete. Use RUBY_GC_HEAP_FREE_SLOTS instead.");
57695772
}
5770-
get_envparam_int ("RUBY_GC_HEAP_FREE_SLOTS", &gc_params.heap_free_slots, 0);
57715773

57725774
/* RUBY_GC_HEAP_INIT_SLOTS */
5773-
if (get_envparam_int("RUBY_HEAP_MIN_SLOTS", &gc_params.heap_init_slots, 0)) {
5774-
rb_warn("RUBY_HEAP_MIN_SLOTS is obsolete. Use RUBY_GC_HEAP_INIT_SLOTS instead.");
5775+
if (get_envparam_int("RUBY_GC_HEAP_INIT_SLOTS", &gc_params.heap_init_slots, 0)) {
57755776
gc_set_initial_pages();
57765777
}
5777-
if (get_envparam_int("RUBY_GC_HEAP_INIT_SLOTS", &gc_params.heap_init_slots, 0)) {
5778+
else if (get_envparam_int("RUBY_HEAP_MIN_SLOTS", &gc_params.heap_init_slots, 0)) {
5779+
rb_warn("RUBY_HEAP_MIN_SLOTS is obsolete. Use RUBY_GC_HEAP_INIT_SLOTS instead.");
57785780
gc_set_initial_pages();
57795781
}
57805782

0 commit comments

Comments
 (0)