Re: More on Lisp structures performance
"Yuri Davidovsky (as work at disclosure dot ie)" <[email protected]>
| Newsgroups | gmane.lisp.lispworks.general |
|---|---|
| Message-ID | <[email protected]> |
> On 24 Jan 2026, at 18:52, Tim Bradshaw <[email protected]> wrote: > > I'm not sure what you mean. The point that I am trying to get across is that there is no way for a valid pointer to have 4 spare bits on a 64 bit system. On a 64 bit system a memory pointer would have 3 spare bits (because memory addresses are incremented by 8 bytes, which requires 3 bits). So for example if you have a boxed double pointer that has a tag of, let’s say 111, you would be able to quickly retrieve it from the heap (possibly even without masking the tag bits out as the last three bits are irrelevant for the system anyway) by simply using the literal value of the pointer. But if you decide to use 4 bits for a tag, then it means you can’t retrieve a value from the heap easily because it won’t be a valid pointer anymore. You still can build a system that uses an arbitrary number of bits for tagging the values it operates on and use bit shifting to compensate for that on each memory access, but you will be stroking the 64 bit memory access system against the fur. As a side note, a valid pointer on a 64 bit system may actually have more bits than 3 to spare. The thing is, while the size of the pointer is 64 bits (with the three leftmost bits unused), the addressing space is much smaller, say 40 bits (or 1TB of addressable space), which means that (in theory) we may have 24 additional upper bits to play with without making the pointer invalid. _______________________________________________ Lisp Hug - the mailing list for LispWorks users [email protected] http://www.lispworks.com/support/lisp-hug.html