Function l2_cache_size

Source
pub fn l2_cache_size() -> Option<usize>
Expand description

Returns the total size in bytes of the unified L2 cache.

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 system has no unified L2 cache.

This is computed as associativity * line_size * sets, and if there are multiple caches available, it returns the size of the smallest cache.