Because having to normalize pointers for comparison
Therefore It's not an issue. because you can't get two such pointers
without invoking undefined behavior.
That depends entirely on how the code is generated, particularly
how pointer math is done. Occasional (as opposed to always or
never) normalization could get you in that situation. The implementor
needs to make decisions consistent with the requirements of ANSI
C. Things like how pointer math is done, how pointer comparisons
are done, and the maximum size of objects have to work together to
do things right. You can't have fast pointer math, fast pointer
comparisons, and objects as big as you want. You also have to take
into accounts any short cuts done as a way of speeding up the code.
If you pull normalization out of a loop, given that it's a known
short loop and the pointer can't possibly overflow, then you have
to deal with that if the pointer is passed from inside the loop to
another function, which CANNOT assume that "pointers are always
normalized" any more, unless the code normalizes pointers before
they are passed to a function.
That's what the huge memory model was for, and it gave you a 32-bit
size_t and automatic normalisation of pointers.
The implementor has to decide whether he wants "large" or "huge" model,
or something in between, and probably wants to be able to generate
faster code where enough is known about the situation to justify it.
Huge model wasn't the only way to have huge objects, for example you
can use farmalloc() in one of the other memory models but as soon as
you do that you're outside the standard.
If you are trying to come up with a "nice" implementation, maybe
you don't want the introduction of farmalloc() to break pointer
comparison. So you generate one set of code where the pointers
might have come from farmalloc() , and you generate (probably faster)
code where you know the pointers couldn't have come from farmalloc()
(e.g. taking the address of an auto variable). You might also
take the code for farmalloc() and rename it malloc().
Gordon L. Burditt