aboutsummaryrefslogtreecommitdiffstats
path: root/ext/objspace
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-08-10 01:08:02 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-08-10 01:08:02 +0000
commitb96499f0949a6cbd68662330224040badb92271e (patch)
treea43ac937428fd78562f2264a09d20b7e45d27e06 /ext/objspace
parent1d2d307c5cb0aecccfe1c31f0f7667a252c4178f (diff)
downloadruby-b96499f0949a6cbd68662330224040badb92271e.tar.gz
objspace.c: use rb_ident_hash_new
* ext/objspace/objspace.c (reachable_objects_from_root): use rb_ident_hash_new instead of funcall Hash#compare_by_id. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51515 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/objspace')
-rw-r--r--ext/objspace/objspace.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/ext/objspace/objspace.c b/ext/objspace/objspace.c
index a268be8f76..08d41b8365 100644
--- a/ext/objspace/objspace.c
+++ b/ext/objspace/objspace.c
@@ -744,8 +744,7 @@ reachable_object_from_root_i(const char *category, VALUE obj, void *ptr)
else {
data->last_category = category;
category_str = data->last_category_str = rb_str_new2(category);
- category_objects = data->last_category_objects = rb_hash_new();
- rb_funcall(category_objects, rb_intern("compare_by_identity"), 0);
+ category_objects = data->last_category_objects = rb_ident_hash_new();
if (!NIL_P(rb_hash_lookup(data->categories, category_str))) {
rb_bug("reachable_object_from_root_i: category should insert at once");
}
@@ -781,10 +780,9 @@ static VALUE
reachable_objects_from_root(VALUE self)
{
struct rofr_data data;
- VALUE hash = data.categories = rb_hash_new();
+ VALUE hash = data.categories = rb_ident_hash_new();
data.last_category = 0;
- rb_funcall(hash, rb_intern("compare_by_identity"), 0);
rb_objspace_reachable_objects_from_root(reachable_object_from_root_i, &data);
rb_hash_foreach(hash, collect_values_of_values, hash);