@asb The jump from 24 to 32-bit virtual addresses produced quite a stir in the old Motorola-based Macs and early ARM-based Acorn systems. Reading through the top of this article filled me with the same old dread, and yet I still find myself uttering the traditional words of hubris:
"128 terabytes per process should be enough for everyone."
@asb Nice explanation and overview of examples! Thank you for sharing.
Since you asked for more examples: Øyvind Kolås has experimented with using the least significant bit trick for string interning of ultra-short strings in the pointer to the string itself. He describes his findings here: https://squoze.org/
@asb I have found that these sort of tricks are usually avoidable. However, these tricks can be kind of necessary when working with lock-free algorithms. You need bit hacking to fit in ABA tags as many architecture just don't offer wide enough atomic operations.
You can also use indexes/side tables but it gets messy.
struct node {
_Atomic uint8_t next;
};
struct info;
struct info infos[];
struct info {
uint64_t aba;
struct node *node;
};
Then preallocate the nodes at startup.