Earlier quoted context omitted.
I suspect it's just circumstantial - two different design approaches. Both of the approaches have their advantages and disadvantages. IMHO the bigger issue with NaN-boxing is that on 64-bit systems it relies on the address space only needing On the other hand, I love the fact that NaN-boxing basically lets you eliminate all heap allocations for doubles. I actually wrote a small article a while back on a hybrid approa…
> IMHO the bigger issue with NaN-boxing is that on 64-bit systems it relies on the address space only needing Is this right? You get 51 tag bits, of which you must use one to distinguish pointer-to-object from other uses of the tag bits (assuming Huffman-ish coding of tags). But objects are presumedly a minimum of 8-byte sized and aligned, and on most platforms I assume they'd be 16-byte sized and aligned, which mean…
But fair point on the aligned pointers - that would give you some free bits to keep using, but it gets ugly.
You're right about the 51 bits - I always get mixed up about whether it's 12 bits of exponent, or the 12 includes the sign. Point is it puts some hard constraints on a pretty large number of high bits of a pointer being free, as opposed to an alignment requirement for low-bit tagging which will never run out of bits.