Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.



Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: