Re: why use memcpy when memmove is there

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

 



the implimentation of memcpy in arch specific files seems to be more efficient than the generic memcpy/memmove :)

http://lxr.linux.no/source/arch/m68k/lib/string.c#L79


On 8/14/07, pradeep singh <2500.pradeep@xxxxxxxxx> wrote:
On 8/14/07, arshad hussain <arshad.super@xxxxxxxxx> wrote:
[snip]
> > then why is memcpy present in the sources can't we
> > simply do
> >
> > "#define memcpy memmove" in include/linux/string.h
> >
> > or am I missing something?

I don't know but memcpy generates better asm code AFAIK.
Essentially memove is nothing but
int memmove(void *dest, void *src, size_t n)
{
//some checks
//some adjustments to src and destination as they may overlap as per
//definition.

memcpy(dest, src, n);

}

thanks
> >
> > Regards
> > Sri--
> > SK Malik
> >
> > --
> > To unsubscribe from this list: send an email with
> > "unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
> > Please read the FAQ at http://kernelnewbies.org/FAQ
> >
> >
>
> Hi Sri,
>
> My guess ...
>  1. fitness of purpose,
> 2. memcpy _MAY_ be faster than memmove
>
> Thank You
>
>


--
play the game



--
SK Malik

[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