From f41eaf8431d4ed41f6024aeabc5f21a27f6b7223 Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 3 Nov 2009 23:50:51 +0000 Subject: * 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: svn+ssh://ci.ruby-lang.org/ruby/trunk@25640 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- string.c | 26 -------------------------- 1 file changed, 26 deletions(-) (limited to 'string.c') diff --git a/string.c b/string.c index f67997939d..ae1e3154e4 100644 --- a/string.c +++ b/string.c @@ -1992,32 +1992,6 @@ rb_str_concat(VALUE str1, VALUE str2) return rb_str_append(str1, 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) { -- cgit v1.2.3