[ruby-cvs:64158] nobu:r56992 (trunk): switching hash removal

nobu at ruby-lang.org nobu at ruby-lang.org
Tue Dec 6 13:43:48 JST 2016


nobu	2016-12-06 13:43:48 +0900 (Tue, 06 Dec 2016)

  New Revision: 56992

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

  Log:
    switching hash removal
    
    * st.h (struct st_hash_type): Remove strong_hash.
      (struct st_table): Remove inside_rebuild_p and curr_hash.
    * st.c (do_hash): Use type->hash instead of curr_hash.
      (make_tab_empty): Remove setting up curr_hash.
      (st_init_table_with_size): Remove setting up inside_rebuild_p.
      (rebuild_table): Remove clearing inside_rebuild_p.
      (reset_entry_hashes, HIT_THRESHOULD_FOR_STRONG_HASH): Remove code
      recognizing a denial attack and switching to strong hash.
    * hash.c (rb_dbl_long_hash, rb_objid_hash, rb_ident_hash): Use
      rb_hash_start to randomize the hash.
      (str_seed): Remove.
      (any_hash): Remove strong_p and use always rb_str_hash for
      strings.
      (any_hash_weak, rb_any_hash_weak): Remove.
      (st_hash_type objhash): Remove rb_any_hash_weak.
    
    based on the patch by Vladimir N Makarov <vmakarov at redhat.com> at
    [ruby-core:78490].  [Bug #13002]
    
    * test/ruby/test_hash.rb (test_wrapper): objects other than special
      constants should be able to be wrapped.

  Modified files:
    trunk/hash.c
    trunk/include/ruby/st.h
    trunk/st.c
    trunk/test/ruby/test_hash.rb
    trunk/test/ruby/test_string.rb


More information about the ruby-cvs mailing list