Re: Question about memcpy

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

 



agree! a simple rename would survice.results are the same .kernel is faster
could anyone help fix this ?

2018-07-11 0:03 GMT+08:00 <valdis.kletnieks@xxxxxx>:
On Tue, 10 Jul 2018 22:51:34 +0800, bing zhu said:

> Thank you ,I use this func for both kernel and user ,result are same.
> void *memcpy(void *dest, const void *src, size_t n)
> {

Might want to use 'void *my_memcpy(..)' instead, just in case the build
environment plays #define games with you and causes a different memcpy()
to get invoked instead.

[/usr/src/linux-next] egrep -r '#define\s*memcpy\(' include/ arch/*/include
arch/arm64/include/asm/string.h:#define memcpy(dst, src, len) __memcpy(dst, src, len)
arch/m68k/include/asm/string.h:#define memcpy(d, s, n) __builtin_memcpy(d, s, n)
arch/sparc/include/asm/string.h:#define memcpy(t, f, n) __builtin_memcpy(t, f, n)
arch/x86/include/asm/string_64.h:#define memcpy(dst, src, len)                                  \
arch/x86/include/asm/string_64.h:#define memcpy(dst, src, len) __memcpy(dst, src, len)
arch/x86/include/asm/string_32.h:#define memcpy(t, f, n)                                \
arch/x86/include/asm/string_32.h:#define memcpy(t, f, n) __builtin_memcpy(t, f, n)
arch/x86/include/asm/string_32.h:#define memcpy(t, f, n)                                \
arch/xtensa/include/asm/string.h:#define memcpy(dst, src, len) __memcpy(dst, src, len)


_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]

  Powered by Linux