Function cache_size::cache_size[][src]

pub fn cache_size(level: u8, ctype: CacheType) -> Option<usize>

Returns the total size in bytes of level cache with type ctype.

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.

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