#[derive(Debug, Copy, Clone, Ord, PartialOrd, Eq, PartialEq, Hash)]
pub enum NumaAllocationPolicy
{
Default,
Preferred(NumaNodeBitSet),
Bind(NumaNodeBitSet),
Interleave(NumaNodeBitSet),
Local,
}
impl Default for NumaAllocationPolicy
{
#[inline(always)]
fn default() -> Self
{
NumaAllocationPolicy::Default
}
}
impl NumaAllocationPolicy
{
#[cfg(any(target_os = "android", target_os = "linux"))]
#[inline(always)]
fn values(&self) -> (i32, (i32, Option<usize>, usize))
{
use self::NumaAllocationPolicy::*;
match *self
{
Default => (0, NumaNodeBitSet::no_mode_flags_nodemask_maxnode),
Preferred(ref numa_node_bit_set) => (1, numa_node_bit_set.mask_and_size()),
Bind(ref numa_node_bit_set) => (2, numa_node_bit_set.mask_and_size()),
Interleave(ref numa_node_bit_set) => (3, numa_node_bit_set.mask_and_size()),
Local => (4, NumaNodeBitSet::no_mode_flags_nodemask_maxnode),
}
}
}