▲ | menaerus 2 days ago | |||||||
How about taking the advantage of max_align_t pointer alignment guarantees, which on x86-64 Linux (glibc) is 16-bytes? This would leave you with the 4 lowest bits to be used. | ||||||||
▲ | jandrewrogers 2 days ago | parent [-] | |||||||
Unfortunately, low bits vary considerably from a large number to zero. If you need a minimum number of bits to be reliably available then you have to look at the high bits of a pointer. Naturally, implementations use the low bits of alignment makes them available. | ||||||||
|