structure alignment question

Robert Perlberg perl at rdin.UUCP
Fri Oct 3 05:02:07 AEST 1986


If Michael says that his word-oriented string routines are faster, I
wouldn't contradict him (after all, he has been running them).
However, I don't see why it is necessary to have a special set of
functions to handle tha word-aligned case.  The standard functions
could test the alignment of their arguments and handle them
appropriatly.  This would have many advantages:

The optimization would be realized on programs that weren't written to
try to use it.

Programs that were written with the optimization in mind would run on
all machines even if they didn't or couldn't support the optimization.

Compilers that put strings on word boundaries would enhance the
frequency with which the optimization is used without the programmer
having to communicate anything to the string routines.

By the way, Michael, how do your string routines handle the '\0'?

Robert Perlberg
Resource Dynamics Inc.
New York
{philabs|delftcc}!rdin!perl



More information about the Comp.lang.c mailing list