[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: 64 bit->48 bit pointer hacks...



"Dale E. Martin" <dale@the-martins.org> writes:

> Is there some magic value I can write into "flag", that in combination with
> the understanding of how 64 bit pointers get truncated down to 48 bit
> virtual addresses that will allow me to store either a 7 byte string or a
> char * in the same space?

You could use the least significant bit(s) since pointers are aligned
on certain (4 byte?) boundaries.  I think Guile Scheme uses this same
trick (on 32 bits) to flag if the pointer stores an address or a small
integer value.  You might look into how they do it.

-Brett.



Reply to: