Blame SOURCES/ruby-2.2.3-dsym_fstrs-for-object-allocation-gc-phase.patch

6e7d33
From c4e2e5df814e77bfa19dc3ee5e5f907e4f368db9 Mon Sep 17 00:00:00 2001
6e7d33
From: nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>
6e7d33
Date: Thu, 14 May 2015 20:12:59 +0000
6e7d33
Subject: [PATCH] merge revision(s) 49842: [Backport #10933]
6e7d33
6e7d33
	* symbol.c (Init_sym): make dsym_fstrs a hash compared by identity
6e7d33
	  as the keys are unique fstrings, to get rid of running hash and
6e7d33
	  compare methods and causing new object allocation during garbage
6e7d33
	  collection phase.  [ruby-dev:48891] [Bug #10933]
6e7d33
6e7d33
6e7d33
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_2@50493 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
6e7d33
---
6e7d33
 ChangeLog | 7 +++++++
6e7d33
 symbol.c  | 2 +-
6e7d33
 version.h | 6 +++---
6e7d33
 3 files changed, 11 insertions(+), 4 deletions(-)
6e7d33
6e7d33
diff --git a/symbol.c b/symbol.c
6e7d33
index 1127020..696f017 100644
6e7d33
--- a/symbol.c
6e7d33
+++ b/symbol.c
6e7d33
@@ -122,7 +122,7 @@ static const struct st_hash_type symhash = {
6e7d33
 void
6e7d33
 Init_sym(void)
6e7d33
 {
6e7d33
-    VALUE dsym_fstrs = rb_hash_new();
6e7d33
+    VALUE dsym_fstrs = rb_ident_hash_new();
6e7d33
     global_symbols.dsymbol_fstr_hash = dsym_fstrs;
6e7d33
     rb_gc_register_mark_object(dsym_fstrs);
6e7d33
     rb_obj_hide(dsym_fstrs);