It's better to use *zero* in the least significant bit mean that it's an integer.
Then you can do simple add and substract on integers with no extra fuzz. And for pointers, using a small constant offset when dereferencing is free in most cases on most architectures.
/ Niels Möller (igelkottsräddare)
Previous text:
2003-09-29 20:21: Subject: zero_type();
If we get to that, we probably use the lowest bit as a flag: If it's 1 then it's a native integer shifted right one step. If it's 0 then it's a pointer (assuming at least 16 bit alignment should be safe). That would halve the range of native integers, but combined with 64 bit values it shouldn't be much of a problem. It's uncertain if the saved space makes up for the added complexity when handling native integers, though.
/ Martin Stjernholm, Roxen IS