use crate::law::{MemoryTier, NumaNodeId};
#[cfg(not(feature = "std"))]
extern crate alloc;
#[cfg(not(feature = "std"))]
use alloc::boxed::Box;
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct NumaNode {
pub id: NumaNodeId,
pub processors: Box<[u32]>,
pub distances: Box<[u32]>,
pub memory_tier: MemoryTier,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct EfficiencyClass(u8);
impl EfficiencyClass {
pub const LOWEST: Self = Self(0);
#[must_use]
pub const fn new(rank: u8) -> Self {
Self(rank)
}
#[must_use]
pub const fn rank(self) -> u8 {
self.0
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct CoreId(u32);
impl CoreId {
#[must_use]
pub const fn new(index: u32) -> Self {
Self(index)
}
#[must_use]
pub const fn get(self) -> u32 {
self.0
}
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct CacheLevel {
pub level: u32,
pub size_bytes: usize,
pub line_bytes: Option<usize>,
pub shared_processors: Box<[u32]>,
}