mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Do not allocate ractor-local storage in dfree function during GC
This commit is contained in:
parent
0d89aedb73
commit
265c002239
1 changed files with 2 additions and 1 deletions
3
random.c
3
random.c
|
@ -263,7 +263,8 @@ const rb_data_type_t rb_random_data_type = {
|
||||||
static void
|
static void
|
||||||
random_mt_free(void *ptr)
|
random_mt_free(void *ptr)
|
||||||
{
|
{
|
||||||
if (ptr != default_rand())
|
rb_random_mt_t *rnd = rb_ractor_local_storage_ptr(default_rand_key);
|
||||||
|
if (ptr != rnd)
|
||||||
xfree(ptr);
|
xfree(ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue