Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 8/7/84; site ucbvax.ARPA Path: utzoo!watmath!clyde!burl!ulysses!ucbvax!anton From: anton@ucbvax.ARPA (Jeff Anton) Newsgroups: net.lang.c Subject: Re: String copy idiom. Message-ID: <5451@ucbvax.ARPA> Date: Tue, 12-Mar-85 12:18:26 EST Article-I.D.: ucbvax.5451 Posted: Tue Mar 12 12:18:26 1985 Date-Received: Wed, 13-Mar-85 01:15:25 EST References: <7042@watdaisy.UUCP> <7044@watdaisy.UUCP> Reply-To: anton@ucbvax.UUCP (Jeff anton) Distribution: net Organization: University of California at Berkeley Lines: 19 Summary: Daniel J. Salomon writes: >The VAX 4.2 BSD UNIX library routine 'strcpy' uses code equivalent >to the less efficient sequence: while (*s++ = *t++); >Perhaps it should be changed. >In the mean time, if your application does a great deal of >string copying, and you are want to minimize execution time, >you should write your own string copy routine. I believe you are mistaken. The 4.2BSD VAX strcpy is an assembly routine that uses the VAX instruction movc3. Perhaps, your library was built improperly or you defined a new strcpy routine. If you looked at source code you must be carefull since routines in assembly often have C counter parts to be used if the assembly is suspect. -- C knows no bounds. Jeff Anton U.C.Berkeley ucbvax!anton anton@berkeley.ARPA