core_allocator/reexport.rs
1#[cfg(not(target_os = "macos"))]
2pub use nix::sched::CpuSet;
3
4#[cfg(target_os = "macos")]
5#[derive(Copy, Clone)]
6pub struct CpuSet;
7
8#[cfg(target_os = "macos")]
9impl CpuSet {
10 pub fn new() -> Self {
11 Self
12 }
13 pub fn count() -> usize {
14 // we usually have 8 cores on a macbook?
15 8
16 }
17 pub fn set(&mut self, _i: usize) -> Option<()> {
18 Some(())
19 }
20}