2 unstable releases

0.1.0 Feb 25, 2024
0.0.0 Feb 25, 2024

#1758 in Algorithms

Download history 3390/week @ 2024-08-13 2999/week @ 2024-08-20 3073/week @ 2024-08-27 3305/week @ 2024-09-03 2184/week @ 2024-09-10 2915/week @ 2024-09-17 1876/week @ 2024-09-24 2484/week @ 2024-10-01 2624/week @ 2024-10-08 2962/week @ 2024-10-15 2788/week @ 2024-10-22 2659/week @ 2024-10-29 2503/week @ 2024-11-05 2967/week @ 2024-11-12 2233/week @ 2024-11-19 1577/week @ 2024-11-26

9,765 downloads per month
Used in lgalloc

MIT/Apache

19KB
407 lines

numa_maps

A simple library to read the numa_maps file on Linux.

[dependencies]
numa_maps = "0.1"

Example

#[cfg(target_os = "linux")]
let map = numa_maps::NumaMap::from_file("/proc/self/numa_maps").unwrap();
#[cfg(not(target_os = "linux"))]
let map = numa_maps::NumaMap::default();

for region in &map.ranges {
    println!("base: {:x} -> {:?}", region.address, region.properties);
}

Description

numa_maps provides a simple API to read the contents of the numa_maps file. It parses the file into ranges with a base address, a policy, and a list of properties.

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this crate by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

No runtime deps