3 ms·
This sounds like a really interesting idea that I hadn’t really encountered before. Do you have any suggestions for further reading?
by FuckButtons 6y ago
This sounds like a really interesting idea that I hadn’t really encountered before. Do you have any suggestions for further reading?
- masklinn 6y agoThe second paragraph is pointer tagging, it’s used quite a bit, including in the upper bits for some (e.g. objc stashes the ref count in the class pointer). I think Ocaml also does something interesting with integers, IIRC they’re 1 bit less than the normal range and a shift stores a flag in the freed low bit: if the bit is set it’s a shifted integer, otherwise it’s an unshifted pointer to an integer.