sizeof

Guy Harris guy at rlgvax.UUCP
Sat Feb 2 08:34:27 AEST 1985


> Someone also said that ptr's to different objex may be different sizes.
> Where & why?

Where:

On a Zilog 8000 running in segmented mode (24-bit pointers).
On a Motorola 68000.
On an Intel 802*8[68] running large-model code.

Just because a machine supports large pointers doesn't mean that it
supports 32-bit arithmetic well.  The Z8000 probably does 32-bit
arithmetic 16 bits at a time.  The 68000 definitely does, and can't do
32-bit multiplies or divides conveniently at all.

Why:

Because it doesn't say anywhere that you can't.  Because you may not want
to pay the penalty for 32-bit arithmetic.

> I realize that a certain machine may desire this to make implementation
> as efficient as possible, but I think the designers should just bite
> the bullet and make all ptr's the same size.

On this point, I agree.  16-bit "int"s make techniques like using "malloc"
and "realloc" to grow a large table (used by such obscure programs as "nm")
lose big.

	Guy Harris
	{seismo,ihnp4,allegra}!rlgvax!guy



More information about the Comp.lang.c mailing list