From 71afa8164d40f18306fc2ee5a1ccc74f2926379b Mon Sep 17 00:00:00 2001 From: Peter Zhu Date: Tue, 15 Feb 2022 09:55:53 -0500 Subject: Change darray size to size_t and add functions that use GC malloc Changes size and capacity of darray to size_t to support more elements. Adds functions to darray that use GC allocation functions. --- yjit_core.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'yjit_core.c') diff --git a/yjit_core.c b/yjit_core.c index fbe855d04b..1ad709b2ec 100644 --- a/yjit_core.c +++ b/yjit_core.c @@ -558,9 +558,8 @@ add_block_version(block_t *block) if ((unsigned)casted != body->iseq_size) { rb_bug("iseq too large"); } - if (!rb_darray_make(&body->yjit_blocks, casted)) { - rb_bug("allocation failed"); - } + + rb_darray_make(&body->yjit_blocks, casted); #if YJIT_STATS // First block compiled for this iseq @@ -572,9 +571,7 @@ add_block_version(block_t *block) rb_yjit_block_array_t *block_array_ref = rb_darray_ref(body->yjit_blocks, blockid.idx); // Add the new block - if (!rb_darray_append(block_array_ref, block)) { - rb_bug("allocation failed"); - } + rb_darray_append(block_array_ref, block); { // By writing the new block to the iseq, the iseq now -- cgit v1.2.3