lkml.org 
[lkml]   [2007]   [Dec]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] Documentation about unaligned memory access
On 16:11 Mon 03 Dec 2007, Daniel Drake wrote:
> Here's a document I wrote after figuring out what unaligned memory access
> is all about. I've tried to cover the information I was looking for when
> trying to learn about this, without producing a hopelessly detailed/complex
> spew. I hope it is useful to others.
>
> Signed-off-by: Daniel Drake <dsd@gentoo.org>
>
> ---
<snip>
> +These macros work work for memory accesses of any length (not just 32 bits as

Remove a "work" here.

> +in the examples above). Be aware that when compared to standard access of
> +aligned memory, using these macros to access unaligned memory can be costly in
> +terms of performance.
> +
> +If use of such macros is not convenient, another option is to use memcpy(),
> +where the source or destination (or both) are of type u8* or unsigned char*.
> +Due to the byte-wise nature of this operation, unaligned accesses are avoided.

Cheers,

Brandon


\
 
 \ /
  Last update: 2007-12-06 06:13    [W:0.061 / U:1.460 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site