[U-Boot] [PATCH] lib/string: memmove: use memcpy if it is safe to do so

Wolfgang Denk wd at denx.de
Sat Oct 29 15:29:41 CEST 2011


Dear Peter Korsgaard,

In message <87vcr8ofw9.fsf at macbook.be.48ers.dk> you wrote:
>
>  Wolfgang> So you are adding code, making the system even less efficient?  This
>  Wolfgang> sounds to be acounter-productive approach.
> 
> Well, slightly less efficient for the (uncommon) situation where
> src/dest overlaps in return for significantly more efficiency for the
> situation where they don't.

The test which situation we have needs to be always performed, and
adds overhead, especially for short copies.

>  Wolfgang> Can you not instead arrange for arch specific, optimized versions
>  Wolfgang> memmove() to be used?
> 
> That's another option, but more work for implementers - So I would
> prefer this trivial patch instead.
> 
> But I'll drop it if you disagree.

I prefer to keep this code as is, and add optimized versions of
memmove() where needed / wanted.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Anyone who isn't confused here doesn't really know what's going on.


More information about the U-Boot mailing list