Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add initialization of rand for murmur hash

  • Loading branch information...
commit 3fb95bd7f6aae79d4aa65ddc946e8be71fc587eb 1 parent 90a8863
@Watson1978 Watson1978 authored
Showing with 5 additions and 0 deletions.
  1. +5 −0 random.c
View
5 random.c
@@ -860,6 +860,11 @@ Init_RandomSeed(void)
GC_WB(&get_rnd(random)->seed, make_seed_value(initial));
rb_vm_set_default_random(random);
+ struct MT *mt = &default_rnd()->mt;
+ if (!genrand_initialized(mt)) {
+ rand_init(mt, random_seed(0, 0));
+ }
+
hashseed = rb_genrand_int32();
#if SIZEOF_ST_INDEX_T*CHAR_BIT > 4*8
hashseed <<= 32;
Please sign in to comment.
Something went wrong with that request. Please try again.