back to memcpy eh?

Bert Freudenberg bert at isg.cs.uni-magdeburg.de
Fri Dec 14 15:17:27 UTC 2001


On Fri, 14 Dec 2001, Pennell, David wrote:

> I just took a quick look at bcopy and memcpy in FreeBSD 4.1.  bcopy
> is just a simple loop and memcpy is a macro that invokes bcopy.

bcopy/bzero is deprecated in glibc, they suggest memcpy/memset instead.

A comment in string.h states:
   There are two kinds of optimizations:
   - machine-dependent optimizations, most probably using inline
     assembler code; these might be quite expensive since the code
     size can increase significantly.
     These optimizations are not used unless the symbol
        __USE_STRING_INLINES
     is defined before including this header.
   - machine-independent optimizations which do not increase the
     code size significantly and which optimize mainly situations
     where one or more arguments are compile-time constants.
     These optimizations are used always when the compiler is
     taught to optimize.

See here ...
http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/string/bits/?cvsroot=glibc
http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sysdeps/i386/bits/string.h?cvsroot=glibc

-- Bert






More information about the Squeak-dev mailing list