[clug] [OT] Null-terminated strings: expensive mistake or not

Hugh Fisher hugh.fisher at anu.edu.au
Thu Aug 4 19:36:11 MDT 2011


Robert Edwards wrote:
> I'm not sure how this is Motorola's mistake. They can't help how
> the compiler writers for Apple and Sun may have used the extra
> bits of memory that existed in the upper bits of all pointers that
> weren't using all 32-bits.
> 
> Presumably the same issue could recur now that we have 64-bit
> addresses but not so many machines with 16 exabytes of memory and
> so some (many) unused bits to play with in each pointer.

The IBM/Motorola mistake was that on the 24 bit address bus
CPUs, 32 bit pointers 0x00000040 and 0x0A000040 referred to
the same memory location because the top 8 bits were ignored.

When the x86 went 32 bit Intel, in a rare example of actually
learning from the mistakes of others, wired all the unused
address bits into an OR gate or equivalent so you'd get a
memory fault if they were anything but zero. Same thing AFAIK
was done on the transition to 64 bit.

-- 
	Hugh Fisher
	CECS, ANU


More information about the linux mailing list