cache_size/lib.rs
1//! A library to quickly get the size and line size of your CPU caches.
2//!
3//! Currently this crate only supports x86 CPUs, since it relies on the `CPUID` instruction, via
4//! the [`raw_cpuid`](raw_cpuid) crate. It is a goal to support other architectures; PRs are
5//! welcome!
6//!
7//! Note that the library will still compile and work on non x86 architectures, but the result of
8//! all the cache queries will be `None`.
9//!
10//! Check the [Intel 64 and IA-32 Architectures Software Developers Manual](https://software.intel.com/sites/default/files/managed/39/c5/325462-sdm-vol-1-2abcd-3abcd.pdf)
11//! for more information on the `CPUID` instruction.
12
13#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
14mod x86;
15#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
16pub use x86::*;
17
18#[cfg(not(any(target_arch = "x86", target_arch = "x86_64")))]
19mod blanket;
20#[cfg(not(any(target_arch = "x86", target_arch = "x86_64")))]
21pub use blanket::*;