News for hackers. Stuff that matters.
Re:You Can't Always Hash Pointers in C by mikeash on Tuesday May 31, 2016 @04:22PM (#11809883)
That doesn't help. Your assert can be false. Consider, for example, a 32-bit architecture which ignores the top 8 bits of the pointer (as was the case in the old 68000 Macs, as discussed elsewhere in these comments). Consider two pointers which differ only in a top bit, like 0x1000f000 and 0x0000f000. They will compare equal, but the underlying bytes extracted with your memmove call will differ.

And this isn't just a historical curiosity. ARM64 can optionally ignore the top eight bits of its 64-bit pointers, for example.

There are no comments on this comment yet.