Re: 64 bit->48 bit pointer hacks...
> Euuh... I actually thought virtual adres space was... wel... virtual, and
> that the MMU could (and would) map real memory within virtual spaces at
> any location.
That's true.
> If that is true, then I don't think virtual adres space pointers are
> truncated at all,
You're right, they aren't, sizeof(void *) == 8.
> only pointers within physical adres space would. In other words, malloc()
> may return a pointer with very meaningfull bits above the 47nth bit.
That's right. Unless there is 16 bits of "sparseness" required, it means a
lot of bits are going unused per pointer. (I'm mostly kidding here, I DO
understand the evils of assuming stuff and storing data in there.) Still,
it's an intriguing idea for one way of compacting memory usage. People do
love to complain about "bloat", 64 bit pointers with 48 bits of address
space seem like they qualify to me! :-)
> Only when actually accessing real RAM, beyond the MMU, will any pointer
> never exceed the lower 48 bits.
And in fact, the 48 bits is logical, there are only 40 bits physical on the
implementations that I have seen.
I'm just asking if there is a way to make a union of a pointer and some
number of bytes, and looking at the value of said union to know for certain
that it COULDN'T be an address, and therefore know to interpret it as data.
If it's portable and safe, many bonus points... I'm I actually going to do
it? Only if there is a reasonable way too and the benefits outweight the
costs - just like anything else. For now it's fun to think about it... :-)
Thanks,
Dale
--
Dale E. Martin - dale@the-martins.org
http://the-martins.org/~dmartin
Reply to: