Re: why use memcpy when memmove is there

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

 




It's more like:
if (dest <= src)
	do what memcpy does
else
	do basically memcpy, just backwards

If you know that you don't have overlap, you can save yourself a
conditional jump.  Not the biggest optimization, but it can add up if
you call it often, and it's easy, so you might as well take advantage of
it.
just to add to this since memcpy doesnot contain any
conditional jumps it doesnot result in flushing the
instruction pipeline which can happen in case of
memmove.
-pgssgp

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[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