1
Fork 0

Add pointer masking convenience functions

This commit adds the following functions all of which have a signature
`pointer, usize -> pointer`:
- `<*mut T>::mask`
- `<*const T>::mask`
- `intrinsics::ptr_mask`

These functions are equivalent to `.map_addr(|a| a & mask)` but they
utilize `llvm.ptrmask` llvm intrinsic.

*masks your pointers*
This commit is contained in:
Maybe Waffle 2022-05-11 17:52:00 +04:00
parent 48853a361a
commit 10270f4b44
8 changed files with 65 additions and 1 deletions

View file

@ -1112,6 +1112,7 @@ symbols! {
ptr,
ptr_guaranteed_eq,
ptr_guaranteed_ne,
ptr_mask,
ptr_null,
ptr_null_mut,
ptr_offset_from,