structstd.builtin.PrefetchOptions[src]

This data structure is used by the Zig language code generation and therefore must be kept in sync with the compiler implementation.

Fields

rw: Rw = .read

Whether the prefetch should prepare for a read or a write.

locality: u2 = 3

The data's locality in an inclusive range from 0 to 3.

0 means no temporal locality. That is, the data can be immediately dropped from the cache after it is accessed.

3 means high temporal locality. That is, the data should be kept in the cache as it is likely to be accessed again soon.

cache: Cache = .data

The cache that the prefetch should be performed on.

Source Code

Source code
pub const PrefetchOptions = struct {
    /// Whether the prefetch should prepare for a read or a write.
    rw: Rw = .read,
    /// The data's locality in an inclusive range from 0 to 3.
    ///
    /// 0 means no temporal locality. That is, the data can be immediately
    /// dropped from the cache after it is accessed.
    ///
    /// 3 means high temporal locality. That is, the data should be kept in
    /// the cache as it is likely to be accessed again soon.
    locality: u2 = 3,
    /// The cache that the prefetch should be performed on.
    cache: Cache = .data,

    pub const Rw = enum(u1) {
        read,
        write,
    };

    pub const Cache = enum(u1) {
        instruction,
        data,
    };
}