Use xcalloc for allocating shape tree

The GC is initialized by this point, so we can use xcalloc instead of
ruby_mimcalloc.
This commit is contained in:
Peter Zhu 2024-04-24 15:32:32 -04:00
Родитель af24ba4034
Коммит 49753cd082
1 изменённых файлов: 1 добавлений и 2 удалений

Просмотреть файл

@ -1213,8 +1213,7 @@ rb_shape_find_by_id(VALUE mod, VALUE id)
void
Init_default_shapes(void)
{
rb_shape_tree_t *st = ruby_mimcalloc(1, sizeof(rb_shape_tree_t));
rb_shape_tree_ptr = st;
rb_shape_tree_ptr = xcalloc(1, sizeof(rb_shape_tree_t));
#ifdef HAVE_MMAP
rb_shape_tree_ptr->shape_list = (rb_shape_t *)mmap(NULL, rb_size_mul_or_raise(SHAPE_BUFFER_SIZE, sizeof(rb_shape_t), rb_eRuntimeError),