Skip to content
This repository
Browse code

add initialization of rand for murmur hash

  • Loading branch information...
commit 3fb95bd7f6aae79d4aa65ddc946e8be71fc587eb 1 parent 90a8863
Watson authored January 10, 2012

Showing 1 changed file with 5 additions and 0 deletions. Show diff stats Hide diff stats

  1. 5  random.c
5  random.c
@@ -860,6 +860,11 @@ Init_RandomSeed(void)
860 860
     GC_WB(&get_rnd(random)->seed, make_seed_value(initial));
861 861
     rb_vm_set_default_random(random);
862 862
 
  863
+    struct MT *mt = &default_rnd()->mt;
  864
+    if (!genrand_initialized(mt)) {
  865
+	rand_init(mt, random_seed(0, 0));
  866
+    }
  867
+
863 868
     hashseed = rb_genrand_int32();
864 869
 #if SIZEOF_ST_INDEX_T*CHAR_BIT > 4*8
865 870
     hashseed <<= 32;

0 notes on commit 3fb95bd

Please sign in to comment.
Something went wrong with that request. Please try again.