summaryrefslogtreecommitdiff
path: root/thread.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-01-23 02:36:50 (GMT)
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-01-23 02:36:50 (GMT)
commit059ea6e4d8233606d7dd522155744501b274acd4 (patch)
tree5f566d568fa09d85ad8e732f0d36167a53bed788 /thread.c
parent51efda1ef3f17ff87e23d56bb40939d90b0e921c (diff)
hash.c: move Hash specific functions
* hash.c (rb_ident_hash): move compare_by_identity specific function from st.c. * hash.c (rb_ident_hash_new): ditto from thread.c. * st.c (st_numhash): remove ruby's Hash specific implementation. * thread.c (recursive_list_access): use rb_ident_hash_new(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49386 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread.c')
-rw-r--r--thread.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/thread.c b/thread.c
index 5d8ac7e..37c7252 100644
--- a/thread.c
+++ b/thread.c
@@ -4676,14 +4676,6 @@ rb_thread_shield_destroy(VALUE self)
}
static VALUE
-ident_hash_new(void)
-{
- VALUE hash = rb_hash_new();
- rb_hash_tbl_raw(hash)->type = &st_hashtype_num;
- return hash;
-}
-
-static VALUE
threadptr_recursive_hash(rb_thread_t *th)
{
return th->local_storage_recursive_hash;
@@ -4710,7 +4702,7 @@ recursive_list_access(VALUE sym)
VALUE hash = threadptr_recursive_hash(th);
VALUE list;
if (NIL_P(hash) || !RB_TYPE_P(hash, T_HASH)) {
- hash = ident_hash_new();
+ hash = rb_ident_hash_new();
threadptr_recursive_hash_set(th, hash);
list = Qnil;
}
@@ -4718,7 +4710,7 @@ recursive_list_access(VALUE sym)
list = rb_hash_aref(hash, sym);
}
if (NIL_P(list) || !RB_TYPE_P(list, T_HASH)) {
- list = ident_hash_new();
+ list = rb_ident_hash_new();
rb_hash_aset(hash, sym, list);
}
return list;