From 49753cd082b31b82b527eb683c9381cd5787293d Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Wed, 24 Apr 2024 15:32:32 -0400 Subject: [PATCH] Use xcalloc for allocating shape tree The GC is initialized by this point, so we can use xcalloc instead of ruby_mimcalloc. --- shape.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/shape.c b/shape.c index 952d647c60..68c74034e7 100644 --- a/shape.c +++ b/shape.c @@ -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),