summaryrefslogtreecommitdiff
path: root/yjit_core.c
diff options
context:
space:
mode:
authorPeter Zhu <peter@peterzhu.ca>2022-02-15 09:55:53 -0500
committerPeter Zhu <peter@peterzhu.ca>2022-02-16 09:50:29 -0500
commit71afa8164d40f18306fc2ee5a1ccc74f2926379b (patch)
treee3ac0dbc6c245f61a3cf98a7a999ba60c170847d /yjit_core.c
parentf9abb286fb3ddff1caacea6c74d857803df18897 (diff)
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.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/5546
Diffstat (limited to 'yjit_core.c')
-rw-r--r--yjit_core.c9
1 files changed, 3 insertions, 6 deletions
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