summaryrefslogtreecommitdiff
path: root/random.c
diff options
context:
space:
mode:
authorKoichi Sasada <ko1@atdot.net>2020-11-27 17:36:02 +0900
committerKoichi Sasada <ko1@atdot.net>2020-11-27 17:36:02 +0900
commit5496415d3165e57e3ade16238a4cc9ec2c3a81f6 (patch)
tree4dd8c176afc5b1e109281c4816c21880c4070275 /random.c
parent2db2fb9f6c742d5bd0019ccd11c7a375e1b12c0b (diff)
mark default_rand
default_rand can points a Bignum seed, so it should be marked.
Diffstat (limited to 'random.c')
-rw-r--r--random.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/random.c b/random.c
index 22c5449..76183f9 100644
--- a/random.c
+++ b/random.c
@@ -158,6 +158,13 @@ default_rand(void)
return rnd;
}
+void
+rb_default_rand_mark(void *ptr)
+{
+ rb_random_mt_t *rnd = (rb_random_mt_t *)ptr;
+ rb_gc_mark(rnd->base.seed);
+}
+
static rb_random_mt_t *
default_mt(void)
{