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

2023-04-10 Thread Michael Tokarev
09.04.2023 19:27, Richard Henderson пишет: 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

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

2023-04-09 Thread Richard Henderson
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,

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

2023-04-09 Thread Michael Tokarev
09.04.2023 17:04, Warner Losh пишет: On Sun, Apr 9, 2023 at 2:53 AM Michael Tokarev mailto:m...@tls.msk.ru>> 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 ne

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

2023-04-09 Thread Warner Losh
On Sun, Apr 9, 2023 at 2:53 AM 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

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

2023-04-09 Thread Michael Tokarev
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-pla