[ruby-cvs:66922] shyouhei:r59744 (trunk): add rb_hash_new_with_size()

shyouhei at ruby-lang.org shyouhei at ruby-lang.org
Tue Sep 5 13:48:19 JST 2017


shyouhei	2017-09-05 13:48:19 +0900 (Tue, 05 Sep 2017)

  New Revision: 59744

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=59744

  Log:
    add rb_hash_new_with_size()
    
    Sometimes, size of a hash can be calcluated a priori.  By providing
    such info to the constructor we can avoid unnecessary internal re-
    allocations.  This can boost for instance creation of hash literals.
    [Bug #13861]
    
    Signed-off-by: Urabe, Shyouhei <shyouhei at ruby-lang.org>

  Modified files:
    trunk/hash.c
    trunk/insns.def
    trunk/internal.h
    trunk/vm.c


More information about the ruby-cvs mailing list