Path: utzoo!attcan!uunet!seismo!sundc!pitstop!sun!amdcad!ames!haven!ncifcrf!nlm-mcs!adm!smoke!gwyn From: gwyn@smoke.ARPA (Doug Gwyn ) Newsgroups: comp.lang.c Subject: Re: memcpy vs. memmove (was: Re: Explanation, please!) Message-ID: <8482@smoke.ARPA> Date: 13 Sep 88 13:40:47 GMT References: <8389@smoke.ARPA> <7039@bloom-beacon.MIT.EDU> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 12 In article <7039@bloom-beacon.MIT.EDU> scs@adam.pika.mit.edu (Steve Summit) writes: >I'll probably be disgusted by the answer, but can someone explain >why two functions are needed instead of one? Why not just add >the guarantee to memcpy? (1) many people want a fast block-move, many want one that does the "correct" thing on overlaps. Two routines allows the application to choose the trade-off. A vendor could choose to make memcpy just another entry point for memmove. (2) it's possible that some existing (nonportable) applications depend on the specific implementation of their current memcpy().