pub const fn prefetch_write<T>(ptr: *mut T, locality: Locality)🔬This is a nightly-only experimental API. (
hint_prefetch #146941)Expand description
Prefetch the cache line containing ptr for a future write.
A strategically placed prefetch can reduce cache miss latency if the data is 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.