Re: [PATCH] demarshall: Add safe method for unaligned byte access.

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

 



On Wed, Nov 25, 2015 at 09:04:58AM -0500, Frediano Ziglio wrote:
> > 
> > Usefull for ARM. Enable with "USE_MEMCPY" define.
> >  Should be better to add "--use-memcpy" to configure.ac
> > 
> > Signed-off-by: Anton D. Kachalov <mouse@xxxxxxxxxxxxxx>
> 
> Are you sure there are not other way except memcpy?

An alternate way which I proposed was to do
uint16_t my_int = unaligned_int[0] | unaligned_int[1] << 8
but Anton said it was likely to be slower than a memcpy. I don't know
how these unaligned accesses are usually handled in ARM code.
I found
https://github.com/yura-pakhuchiy/snappy-c/commit/a33077391874b36fb4c430ff9ed5f6e437b65f6f
doinng something similar, but that's about it.

Christophe

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]