summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-03-04 02:52:32 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-03-04 02:52:32 +0000
commit5cd98697f846899a529ad57c165ed5b7e265365c (patch)
tree3f8287b223a6d6805add119957f270139de7553d
parentd7628fcfd384235b3313f642fb2a36db890fb6f8 (diff)
downloadruby-5cd98697f846899a529ad57c165ed5b7e265365c.tar.gz
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] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49842 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog7
-rw-r--r--symbol.c2
2 files changed, 8 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index d0fb13541d..307ba8c28b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Wed Mar 4 11:52:30 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * 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@gmail.com>
* enum.c: Fix typo in slice_after's exception message.
diff --git a/symbol.c b/symbol.c
index 1127020d17..696f0177b9 100644
--- a/symbol.c
+++ b/symbol.c
@@ -122,7 +122,7 @@ static const struct st_hash_type symhash = {
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);