summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Zhu <[email protected]>2024-04-24 15:32:32 -0400
committerPeter Zhu <[email protected]>2024-04-25 17:11:34 -0400
commit49753cd082b31b82b527eb683c9381cd5787293d (patch)
tree8072eb581b9562b531bce8d4b60d6cd019be88b1
parentaf24ba40344cdd83865c7c580756352be526794a (diff)
Use xcalloc for allocating shape tree
The GC is initialized by this point, so we can use xcalloc instead of ruby_mimcalloc.
-rw-r--r--shape.c3
1 files changed, 1 insertions, 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),