summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
authorPeter Zhu <peter@peterzhu.ca>2023-08-30 16:49:32 -0400
committerPeter Zhu <peter@peterzhu.ca>2023-08-30 19:37:11 -0400
commit0aa404b9573d028d87072f40ecb9b86dc161b7ef (patch)
treea076ccf82c7c58b4835d036101d8ce1a8616096c /gc.c
parent4aa98b2760944b04b827d6ba4037548a93ef94ff (diff)
Change heap init environment variable names
This commit changes RUBY_GC_HEAP_INIT_SIZE_{40,80,160,320,640}_SLOTS to RUBY_GC_HEAP_{0,1,2,3,4}_INIT_SLOTS. This is easier to use because the user does not need to determine the slot sizes (which can vary between 32 and 64 bit systems). They now just use the heap names (`GC.stat_heap.keys`).
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/8335
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gc.c b/gc.c
index 9178c9462f..e2c2779b47 100644
--- a/gc.c
+++ b/gc.c
@@ -11633,8 +11633,8 @@ gc_set_initial_pages(rb_objspace_t *objspace)
for (int i = 0; i < SIZE_POOL_COUNT; i++) {
rb_size_pool_t *size_pool = &size_pools[i];
- char env_key[sizeof("RUBY_GC_HEAP_INIT_SIZE_" "_SLOTS") + DECIMAL_SIZE_OF_BITS(sizeof(size_pool->slot_size) * CHAR_BIT)];
- snprintf(env_key, sizeof(env_key), "RUBY_GC_HEAP_INIT_SIZE_%d_SLOTS", size_pool->slot_size);
+ char env_key[sizeof("RUBY_GC_HEAP_" "_INIT_SLOTS") + DECIMAL_SIZE_OF_BITS(sizeof(int) * CHAR_BIT)];
+ snprintf(env_key, sizeof(env_key), "RUBY_GC_HEAP_%d_INIT_SLOTS", i);
size_t size_pool_init_slots = gc_params.size_pool_init_slots[i];
if (get_envparam_size(env_key, &size_pool_init_slots, 0)) {