Skip to content

Commit

Permalink
[mono][interp] Use memcpy
Browse files Browse the repository at this point in the history
  • Loading branch information
BrzVlad committed Feb 21, 2024
1 parent 59053b6 commit 00c6125
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/mono/mono/mini/interp/transform-opt.c
Original file line number Diff line number Diff line change
Expand Up @@ -1709,8 +1709,7 @@ interp_link_bblocks (TransformData *td, InterpBasicBlock *from, InterpBasicBlock
int new_capacity = get_bb_links_capacity (from->out_count + 1);
if (new_capacity > prev_capacity) {
InterpBasicBlock **newa = (InterpBasicBlock**)mono_mempool_alloc (td->mempool, new_capacity * sizeof (InterpBasicBlock*));
for (i = 0; i < from->out_count; ++i)
newa [i] = from->out_bb [i];
memcpy (newa, from->out_bb, from->out_count * sizeof (InterpBasicBlock*));
from->out_bb = newa;
}
from->out_bb [from->out_count] = to;
Expand All @@ -1729,8 +1728,7 @@ interp_link_bblocks (TransformData *td, InterpBasicBlock *from, InterpBasicBlock
int new_capacity = get_bb_links_capacity (to->in_count + 1);
if (new_capacity > prev_capacity) {
InterpBasicBlock **newa = (InterpBasicBlock**)mono_mempool_alloc (td->mempool, new_capacity * sizeof (InterpBasicBlock*));
for (i = 0; i < to->in_count; ++i)
newa [i] = to->in_bb [i];
memcpy (newa, to->in_bb, to->in_count * sizeof (InterpBasicBlock*));
to->in_bb = newa;
}
to->in_bb [to->in_count] = from;
Expand Down

0 comments on commit 00c6125

Please sign in to comment.