structure alignment question

Michael Tiemann tiemann at mcc-pp.UUCP
Mon Oct 6 03:45:59 AEST 1986


In article <581 at rdin.UUCP>, perl at rdin.UUCP (Robert Perlberg) writes:
> If Michael says that his word-oriented string routines are faster, I
> wouldn't contradict him (after all, he has been running them).

The 68000 had no loop-mode, so they were faster. But with the advent
of superior technology, and a corresponding *lack* of followup
on my part, the great assumptions I made in 1982 no longer applied.
Whether or not they should have applied is a philosophical matter
taht has been resolved to my satisfaction (= no).

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

I used these routines for symbol-table management, and therefore,
never had any of these nasty cases to deal with. I have been
duly humbled, and will not feel slighted in the least if we drop
this discussion.

By the way... It was the numbers that Guy put on the net, that
convinced me I was wrong: wrong beacuse even if *one* assumption
that I make is allowed for by the compiler (by word aligning
strings, for example), there are too many other assumptions
about the hardware that must be taken into account. My moral
of the story is, let the compiler generate the code it is supposed
to, and write your special-purpose functions from there. Asking
for one more inch here or there may be smart-today-dumb-tomorrow,
as in this example.

Michael
tiemann at mcc.com



More information about the Comp.lang.c mailing list