Can I use the mid bits on pointers (on 64-bit machines) to implement things (like tagged pointers)?

120 views Asked by At

Currently current x86_64 (AMD64) machines do not implement the full 64-bit memory space in wiring. Thus, the available memory space is quite less (in my own machine cat /proc/cpuinfo says 36 bits physical, 48 bits virtual).

If we asume, for the sake of the question, that we need not make our application portable for the full 64 bits of addressing.

Then, we have a lot of room in pointers that are effectively being wasted. Can the unusable space (for addressing) be used for the storage of further information, or to use the same data type with an indicator of whether it is a tagged pointer or something else (maybe an immediate small value instead of a pointer)?

I think the most prominent use-case could be to implement run-times, intepreters and compilers of dynamic languages, but I'm sure it can be extended to more usage.

0

There are 0 answers