summaryrefslogtreecommitdiff
path: root/random.c
diff options
context:
space:
mode:
authorNobuyoshi Nakada <[email protected]>2020-09-07 18:56:39 +0900
committerNobuyoshi Nakada <[email protected]>2020-09-07 20:08:01 +0900
commit2b07b24bdf15e4feeb9dae94a17999070cd77121 ()
treebace8aba07da5edfc4e0b7196c6a3baa02e9d0af /random.c
parent4924011262e35e3983e245cbfcff15aee7b295f3 (diff)
Added `rb_random_base_init`
To enclose the initialization of Random::Base part.
Notes: Merged: https://.com/ruby/ruby/pull/3024
-rw-r--r--random.c9
1 files changed, 8 insertions, 1 deletions
@@ -297,12 +297,19 @@ try_rand_if(VALUE obj, rb_random_t *rnd)
}
/* :nodoc: */
static VALUE
random_alloc(VALUE klass)
{
rb_random_mt_t *rnd;
VALUE obj = TypedData_Make_Struct(klass, rb_random_mt_t, &random_mt_type, rnd);
- rnd->base.seed = INT2FIX(0);
return obj;
}