prefetch_read_instruction in std::hint - Rust
Description: Prefetch the cache line containing `ptr` into the instruction cache for a future read.

## prefetch_read_instruction

# Function prefetch_read_instruction

Source

    pub const fn prefetch_read_instruction<T>(ptr: *const T, locality: Locality)

🔬This is a nightly-only experimental API. (`hint_prefetch` #146941)
Expand description

Prefetch the cache line containing `ptr` into the instruction cache for a future read.

A strategically placed prefetch can reduce cache miss latency if the instructions are accessed soon after, but may also increase bandwidth usage or evict other cache lines.

A prefetch is a hint, and may be ignored on certain targets or by the hardware.

Passing a dangling or invalid pointer is permitted: the memory will not actually be dereferenced, and no faults are raised.