Casting Pointers -- fast *portab - (nf)

jab at uokvax.UUCP jab at uokvax.UUCP
Wed Feb 15 14:25:25 AEST 1984


#R:kobold:-27200:uokvax:3000016:000:825
uokvax!jab    Feb 12 19:58:00 1984

kobolt!tjt proposed a byte-copying mechanism that was basically a loop
that copied N bytes for every iteration of the loop instead of one byte
per iteration.

I'd say that if you get to that particular point, what you do is create
a library routine called "copybytes" that is as machine-dependent as need
be to get the speed you want, but that is retargeted on a per-machine basis,
similar to the "strlen" and "index/rindex" code I've seen written for the
VAX-11 already.

I don't like the idea of adding "magic" control structures in order to
outsmart the compiler, and I like the "asm" hack even less. Why not segregate
the parts of the program that need to run FAST into separate modules and work
on making those modules fast? The above library routine might be an example;
there are many others.

	Jeff Bowles
	Lisle, IL



More information about the Comp.lang.c mailing list