File tree Expand file tree Collapse file tree 4 files changed +114
-66
lines changed
Expand file tree Collapse file tree 4 files changed +114
-66
lines changed Original file line number Diff line number Diff line change 1010 os :
1111 - ubuntu
1212 - macos
13+ - windows
1314 toolchain :
1415 - stable
1516 - 1.72
Original file line number Diff line number Diff line change 11[package ]
22name = " numa_maps"
3- version = " 0.0 .0"
3+ version = " 0.1 .0"
44edition = " 2021"
55authors = [" Moritz Hoffmann <antiguru@gmail.com>" ]
66description = " Parse the numa_maps file"
Original file line number Diff line number Diff line change @@ -11,8 +11,23 @@ numa_maps = "0.1"
1111## Example
1212
1313``` rust
14+ #[cfg(target_os = " linux" )]
15+ let map = numa_maps :: NumaMap :: from_file (" /proc/self/numa_maps" ). unwrap ();
16+ #[cfg(not(target_os = " linux" ))]
17+ let map = numa_maps :: NumaMap :: default ();
18+
19+ for region in & map . ranges {
20+ println! (" base: {:x} -> {:?}" , region . address, region . properties);
21+ }
22+
1423```
1524
25+ ## Description
26+
27+ ` numa_maps ` provides a simple API to read the contents of the ` numa_maps ` file.
28+ It parses the file into ranges with a base address, a policy, and a list of
29+ properties.
30+
1631#### License
1732
1833<sup >
You can’t perform that action at this time.
0 commit comments