__arm_mte_create_random_tag in core::arch::aarch64 - Rust
Description: Return a pointer containing a randomly generated logical address tag.

core::arch::aarch64

# Function __arm_mte_create_random_tag

Source

    pub unsafe fn __arm_mte_create_random_tag<T>(
        src: *const T,
        mask: u64,
    ) -> *const T

🔬This is a nightly-only experimental API. (`stdarch_aarch64_mte` #129010)
Available on (AArch64 or `target_arch="arm64ec"`) and target feature `mte` only.
Expand description

Return a pointer containing a randomly generated logical address tag.

`src`: A pointer containing an address. `mask`: A mask where each of the lower 16 bits specifies logical tags which must be excluded from consideration. Zero excludes no tags.

The returned pointer contains a copy of the `src` address, but with a randomly generated logical tag, excluding any specified by `mask`.

SAFETY: The pointer provided by this intrinsic will be invalid until the memory has been appropriately tagged with `__arm_mte_set_tag`. If using that intrinsic on the provided pointer is itself invalid, then it will be permanently invalid and Undefined Behavior to dereference it.