merge revision(s) 265c002239: [Backport #17653]

Do not allocate ractor-local storage in dfree function during GC

	---
	 random.c | 3 ++-
	 1 file changed, 2 insertions(+), 1 deletion(-)
This commit is contained in:
NARUSE, Yui 2021-03-02 18:27:43 +09:00
parent 5816725ccc
commit 713d6d5eb0
2 changed files with 3 additions and 2 deletions

View file

@ -261,7 +261,8 @@ const rb_data_type_t rb_random_data_type = {
static void
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);
}