pub fn cache_line_size(level: u8, cache_type: CacheType) -> Option<usize>Expand description
Returns the line size in bytes of level cache with type cache_type.
The only possibilities for this returning None are if the system does not support cache
parameters, in which case get_cache_parameters() will
fail, or if the selected cache level and/or type does not exist.
On an AMD Zen architecture this is computed using tlb info. Instruction and data cache line sizes are available separately for the L1 cache, but only unified is available for L2 and L3 caches.
On other x86 architectures this is computed from
coherency_line_size(),
and if there are multiple caches available, it returns the size of the smallest cache.