From: Wolfgang Denk Date: Sat, 29 Oct 2011 15:29:41 +0200 Subject: [U-Boot] [PATCH] lib/string: memmove: use memcpy if it is safe to do so In-Reply-To: <87vcr8ofw9.fsf@macbook.be.48ers.dk> References: <1319789046-17715-1-git-send-email-jacmet@sunsite.dk> <20111028202530.1231B1809855@gemini.denx.de> <87vcr8ofw9.fsf@macbook.be.48ers.dk> Message-ID: <20111029132941.04C1F1809856@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Peter Korsgaard, In message <87vcr8ofw9.fsf@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.