memcpy performance

Chris Johns cjohns at
Tue Dec 9 06:40:41 UTC 1997

I was having performance problems with 'memcpy' and checked the source
for newlib-1.7.0-posix (same in 1.8.0) and to my suprise found memcpy to
be a byte by byte copy.

Wondering what dependence RTEMS (3.6.0)  had on this so I checked the

 $ fgrep memcpy `find . -name "*.inl" -print`
./exec/score/inline/coremsg.inl:#include <string.h>   /* needed for
memcpy */
./exec/score/inline/coremsg.inl:  memcpy(destination, source, size);
./exec/score/macros/coremsg.inl:  memcpy( _destination, _source, _size)

The actual routine:

RTEMS_INLINE_ROUTINE void _CORE_message_queue_Copy_buffer (
  void      *source,
  void      *destination,
  unsigned32 size
  memcpy(destination, source, size);

So it looks like the message queue core uses byte by byte copies for

Is this a good thing considering the fast and large bus sizes of newer
CPUs ?

 Chris Johns  Networks, Plessey Asia Pacfic Pty. Ltd.
  mailto:ccj at    mailto:cjohns at

More information about the users mailing list