machines with oddball char * formats
William E. Westfield
billw at navajo.STANFORD.EDU
Thu Nov 20 10:48:25 AEST 1986
In article <1534 at batcomputer.tn.cornell.edu>, garry at batcomputer) writes:
>
> Forgive my ignorance, but why don't the compiler writers on these "odd"
> machines just designate a "char" and a "byte" to be the identical width
> to a "short" ? What will go wrong ?
>
> (Would very many real-life application programs actually be hurt by the
> added memory usage? - I'm excluding text editors!)
>
> It seems so simple - give some memory, get a lot more speed.
>
this is a word addressable machine. A short is 36 bits. Giving up
some memory for the sake of speed is one thing, but you are talking
about wasting 77% of the memory. Given paging, it probably wouldn't
even be faster. For typical C code dealing with character stings or
arrays, the byte operations asren't that much slower than individual
memory moves, given cache, and the fact that the byte instructions
auto-increment, and memory instructions don't.
BillW
More information about the Comp.lang.c
mailing list