Thread overview
Re: Could we get a LP64 version identifier?
Jan 27, 2009
bearophile
Jan 27, 2009
Don
Jan 27, 2009
Frits van Bommel
January 27, 2009
Walter Bright:
> Frits van Bommel:
> > [1]: Hey, x86 technically has 6-byte pointers if you count segments as part of the pointer (which would be mostly useless on currently popular operating systems though).
> 
> It does, but I know of no compiler that supports that (C, C++, or any other), and code that needs to deal with that tends to be assembler.

16 free bits suggest various possible usages, for example the length for small strings/arrays, halving the size of the array struct.

Bye,
bearophile
January 27, 2009
bearophile wrote:
> Walter Bright:
>> Frits van Bommel:
>>> [1]: Hey, x86 technically has 6-byte pointers if you count segments as part of the pointer (which would be mostly useless on currently popular operating systems though).
>> It does, but I know of no compiler that supports that (C, C++, or any other), and code that needs to deal with that tends to be assembler.
> 
> 16 free bits suggest various possible usages, for example the length for small strings/arrays, halving the size of the array struct.
> 
> Bye,
> bearophile

They're not free bits. Those bits are in the segment registers, not in the pointer registers. Only the OS can change the segment registers. And it's a slow operation.
January 27, 2009
bearophile wrote:
> Walter Bright:
>> Frits van Bommel:
>>> [1]: Hey, x86 technically has 6-byte pointers if you count segments as part of the pointer (which would be mostly useless on currently popular operating systems though).
>> It does, but I know of no compiler that supports that (C, C++, or any other), and code that needs to deal with that tends to be assembler.
> 
> 16 free bits suggest various possible usages, for example the length for small strings/arrays, halving the size of the array struct.

It's not that there are 16 extra bits available, it's that technically to specify a memory location you need to specify 16 more bits in one of a couple special registers. In practice though, these are pretty much always the same (or equivalent, at least).