Skip to content

Commit 00c6125

Browse files
committed
[mono][interp] Use memcpy
1 parent 59053b6 commit 00c6125

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/mono/mono/mini/interp/transform-opt.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1709,8 +1709,7 @@ interp_link_bblocks (TransformData *td, InterpBasicBlock *from, InterpBasicBlock
17091709
int new_capacity = get_bb_links_capacity (from->out_count + 1);
17101710
if (new_capacity > prev_capacity) {
17111711
InterpBasicBlock **newa = (InterpBasicBlock**)mono_mempool_alloc (td->mempool, new_capacity * sizeof (InterpBasicBlock*));
1712-
for (i = 0; i < from->out_count; ++i)
1713-
newa [i] = from->out_bb [i];
1712+
memcpy (newa, from->out_bb, from->out_count * sizeof (InterpBasicBlock*));
17141713
from->out_bb = newa;
17151714
}
17161715
from->out_bb [from->out_count] = to;
@@ -1729,8 +1728,7 @@ interp_link_bblocks (TransformData *td, InterpBasicBlock *from, InterpBasicBlock
17291728
int new_capacity = get_bb_links_capacity (to->in_count + 1);
17301729
if (new_capacity > prev_capacity) {
17311730
InterpBasicBlock **newa = (InterpBasicBlock**)mono_mempool_alloc (td->mempool, new_capacity * sizeof (InterpBasicBlock*));
1732-
for (i = 0; i < to->in_count; ++i)
1733-
newa [i] = to->in_bb [i];
1731+
memcpy (newa, to->in_bb, to->in_count * sizeof (InterpBasicBlock*));
17341732
to->in_bb = newa;
17351733
}
17361734
to->in_bb [to->in_count] = from;

0 commit comments

Comments
 (0)