Zig 0.17.0-dev (Split by item)

Shortcut keys
?
Show these tips
S
Focus search field
Esc
Clear focus & close tips
U
Jump to source code
↑
Move up in search results
↓
Move down in search results
↵
Go to active search result
This is an example of documentation generated by ZigDoc, an alternative to Zig's built-in Auto Doc feature. See also examples in other modes/formats. The project being documented here (as the example) is the Zig standard library. Public Struct

PrefetchOptions

Public Struct
std.lang.PrefetchOptions
pub const PrefetchOptions = struct

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.

Types

File

lang.zig:1176
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
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,
    };
}