prefetch_read

Function prefetch_read 

Source
pub unsafe fn prefetch_read<T>(addr: *const T)
Expand description

Prefetch memory locations to reduce timing variation

This is a hint to the CPU to prefetch data into cache. May help reduce timing variation in subsequent accesses.

ยงSafety

The caller must ensure that addr is a valid, aligned pointer to initialized memory of type T.

Note: This is a best-effort hint. On stable Rust, this uses a volatile read to trigger a cache line load. For true prefetch intrinsics, use nightly Rust.