qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: qemu-user: avoid allocations to convert stuff when not necessary


From: Richard Henderson
Subject: Re: qemu-user: avoid allocations to convert stuff when not necessary
Date: Sun, 9 Apr 2023 09:27:28 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0

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

[Prev in Thread] Current Thread [Next in Thread]