lkml.org 
[lkml]   [2011]   [Nov]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: Fast memcpy patch
From
Date
On Wed, 2011-11-23 at 12:25 +0100, N. Coesel wrote:
> Dear readers,
> I noticed the Linux kernel still uses a byte-by-byte copy method for
> memcpy. Since most memory allocations are aligned to the integer size
> of a cpu it is often faster to copy by using the CPU's native word
> size. The patch below does that. The code is already at work in many
> 16 and 32 bit embedded products. It should also work for 64 bit
> platforms. So far I only tested 16 and 32 bit platforms.

[snip]

memcpy (along with other mem* functions) are arch specific - for
example, look at arch/x86/lib/memcpy_64.S for the implementation(s) for
x86.

The code under lib/string.c is simple and should work on all platforms
(and is probably not being used anywhere anymore).

--

Sasha.



\
 
 \ /
  Last update: 2011-11-23 13:15    [W:1.153 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site