10 ms·
I see that in the readme but I don't see where that's handled in the bitmasking. It appears to be universally masking high-order bits here: https://github.com/
by couchand 2y ago
I see that in the readme but I don't see where that's handled in the bitmasking. It appears to be universally masking high-order bits here: https://github.com/irrustible/ointers/blob/1961f75bbb9818d72f59a3601997bf8a34952005/src/lib.rs#L460-L464 https://github.com/irrustible/ointers/blob/1961f75bbb9818d72...
- formerly_proven 2y agoRead the function above the function you linked to.
- couchand 2y agoOh that's frightening they shift the entire pointer by the alignment
- db48x 2y agoWhy? Alignment causes some low–order bits to be zero. Shifting the pointer to the right drops those zeros on the floor, leaving high–order bits zero (or sign extended or whatever). Then you can put your tag up there instead. Shifting the value left by the same amount drops the tag and recovers the same pointer for use.
- vlovich123 2y agoAny idea why it's preferred to do the alignment route instead of storing the bits in the upper part of the pointer & masking?
- db48x 2y agoPersonal preference, architectural differences, phase of the moon, etc, etc.
- couchand 2y agoMy guideline with pointer tricks is: if you're not just masking bits it's too complicated for real use.