On 4/9/23 01:52, Michael Tokarev wrote:
Hi!

In the qemu-user case, we allocate various structures and arrays
for conversion of data between host and guest byte orders and sizes.
But it is actually not necessary to do such allocation when the
*size* is the same, and only byte order is different, because the
conversion can be done in-place.  Does it make any sense to avoid'
allocations in such cases?

Alignment can also change. This is especially visible with m68k guest, where even 'int' is 2-byte aligned.

So, no.  It's best to just allocate and convert always.


r~

Reply via email to