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

ruby-changes:37761

From: nobu <ko1@a...>
Date: Wed, 4 Mar 2015 11:52:38 +0900 (JST)
Subject: [ruby-changes:37761] nobu:r49842 (trunk): symbol.c: make dsym_fstrs an identity hash

nobu	2015-03-04 11:52:32 +0900 (Wed, 04 Mar 2015)

  New Revision: 49842

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

  Log:
    symbol.c: make dsym_fstrs an identity hash
    
    * symbol.c (Init_sym): make dsym_fstrs a hash compared by identity
      as the keys are unique fstrings, to get rid of running hash and
      compare methods and causing new object allocation during garbage
      collection phase.  [ruby-dev:48891] [Bug #10933]

  Modified files:
    trunk/ChangeLog
    trunk/symbol.c
Index: symbol.c
===================================================================
--- symbol.c	(revision 49841)
+++ symbol.c	(revision 49842)
@@ -122,7 +122,7 @@ static const struct st_hash_type symhash https://github.com/ruby/ruby/blob/trunk/symbol.c#L122
 void
 Init_sym(void)
 {
-    VALUE dsym_fstrs = rb_hash_new();
+    VALUE dsym_fstrs = rb_ident_hash_new();
     global_symbols.dsymbol_fstr_hash = dsym_fstrs;
     rb_gc_register_mark_object(dsym_fstrs);
     rb_obj_hide(dsym_fstrs);
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 49841)
+++ ChangeLog	(revision 49842)
@@ -1,3 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Wed Mar  4 11:52:30 2015  Nobuyoshi Nakada  <nobu@r...>
+
+	* symbol.c (Init_sym): make dsym_fstrs a hash compared by identity
+	  as the keys are unique fstrings, to get rid of running hash and
+	  compare methods and causing new object allocation during garbage
+	  collection phase.  [ruby-dev:48891] [Bug #10933]
+
 Wed Mar  4 10:16:57 2015  SHIBATA Hiroshi  <shibata.hiroshi@g...>
 
 	* enum.c: Fix typo in slice_after's exception message.

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

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