summaryrefslogtreecommitdiffstats
path: root/string.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-11-03 23:50:51 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-11-03 23:50:51 +0000
commit757fb65d4cac47d8c85abf403be2d9c0718acf47 (patch)
treebde99756473189052267740720fac9034821c614 /string.c
parent93263c3a61f2ad6b32eed0d279568955cb079128 (diff)
downloadruby-757fb65d4cac47d8c85abf403be2d9c0718acf47.tar.gz
ruby-757fb65d4cac47d8c85abf403be2d9c0718acf47.tar.xz
ruby-757fb65d4cac47d8c85abf403be2d9c0718acf47.zip
* random.c (rb_hash_start): moved from string.c.
* random.c (Init_RandomSeed2): register global address before set. * random.c (Init_RandomSeed): initialize hashseed. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@25640 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r--string.c26
1 files changed, 0 insertions, 26 deletions
diff --git a/string.c b/string.c
index f67997939..ae1e3154e 100644
--- a/string.c
+++ b/string.c
@@ -1993,32 +1993,6 @@ rb_str_concat(VALUE str1, VALUE str2)
}
st_index_t
-rb_hash_start(st_index_t h)
-{
- static int hashseed_init = 0;
- static st_index_t hashseed;
-
- if (!hashseed_init) {
- hashseed = rb_genrand_int32();
-#if SIZEOF_ST_INDEX_T*CHAR_BIT > 4*8
- hashseed <<= 32;
- hashseed |= rb_genrand_int32();
-#endif
-#if SIZEOF_ST_INDEX_T*CHAR_BIT > 8*8
- hashseed <<= 32;
- hashseed |= rb_genrand_int32();
-#endif
-#if SIZEOF_ST_INDEX_T*CHAR_BIT > 12*8
- hashseed <<= 32;
- hashseed |= rb_genrand_int32();
-#endif
- hashseed_init = 1;
- }
-
- return st_hash_start(hashseed + h);
-}
-
-st_index_t
rb_memhash(const void *ptr, long len)
{
return st_hash(ptr, len, rb_hash_start(0));