3 ms·
For those who like me were not sure that the `calloc` call would necessarily allow to tag the returned pointer, I found the explanation in a previous post of th
by p4bl0 6y ago
For those who like me were not sure that the `calloc` call would necessarily allow to tag the returned pointer, I found the explanation in a previous post of this article series:
> It’s important to note that we can only accomplish this tagging scheme because on modern computer systems the lower 3 bits of heap-allocated pointers are 0 because allocations are word-aligned — meaning that all pointers are numbers that are multiples of 8. This lets us a) differentiate real pointers from fake pointers and b) stuff some additional data there in the real pointers.
It's what I suspected, but I didn't know that it was actually safe to assume that.