Function cache_size::l1_cache_size[][src]

pub fn l1_cache_size() -> Option<usize>

Returns the total size in bytes of the L1 data 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 L1 data cache (if it's a unified L1 cache for example).

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