[前][次][番号順一覧][スレッド一覧]

ruby-changes:58488

From: Lourens <ko1@a...>
Date: Tue, 29 Oct 2019 11:41:44 +0900 (JST)
Subject: [ruby-changes:58488] 0095362918 (master): Right size the vm_default_params hash

https://git.ruby-lang.org/ruby.git/commit/?id=0095362918

From 0095362918375fb694345133e33199b01911e594 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Lourens=20Naud=C3=A9?= <lourens@b...>
Date: Mon, 21 Oct 2019 23:49:54 +0100
Subject: Right size the vm_default_params hash


diff --git a/vm.c b/vm.c
index e104688..9f02489 100644
--- a/vm.c
+++ b/vm.c
@@ -2373,7 +2373,7 @@ static VALUE https://github.com/ruby/ruby/blob/trunk/vm.c#L2373
 vm_default_params(void)
 {
     rb_vm_t *vm = GET_VM();
-    VALUE result = rb_hash_new();
+    VALUE result = rb_hash_new_with_size(4);
 #define SET(name) rb_hash_aset(result, ID2SYM(rb_intern(#name)), SIZET2NUM(vm->default_params.name));
     SET(thread_vm_stack_size);
     SET(thread_machine_stack_size);
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]