summaryrefslogtreecommitdiff
path: root/yjit_codegen.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_codegen.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_codegen.c')
-rw-r--r--yjit_codegen.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/yjit_codegen.c b/yjit_codegen.c
index 8b60b85be4..afecf2fbf5 100644
--- a/yjit_codegen.c
+++ b/yjit_codegen.c
@@ -97,9 +97,7 @@ jit_mov_gc_ptr(jitstate_t *jit, codeblock_t *cb, x86opnd_t reg, VALUE ptr)
uint32_t ptr_offset = cb->write_pos - sizeof(VALUE);
if (!SPECIAL_CONST_P(ptr)) {
- if (!rb_darray_append(&jit->block->gc_object_offsets, ptr_offset)) {
- rb_bug("allocation failed");
- }
+ rb_darray_append(&jit->block->gc_object_offsets, ptr_offset);
}
}
@@ -196,7 +194,7 @@ static void
record_global_inval_patch(const codeblock_t *cb, uint32_t outline_block_target_pos)
{
struct codepage_patch patch_point = { cb->write_pos, outline_block_target_pos };
- if (!rb_darray_append(&global_inval_patches, patch_point)) rb_bug("allocation failed");
+ rb_darray_append(&global_inval_patches, patch_point);
}
static bool jit_guard_known_klass(jitstate_t *jit, ctx_t *ctx, VALUE known_klass, insn_opnd_t insn_opnd, VALUE sample_instance, const int max_chain_depth, uint8_t *side_exit);