#[cfg(target_pointer_width = "64")]
pub(crate) const IS_LOCAL_SHIFT: i128 = 127;
#[cfg(target_pointer_width = "64")]
pub(crate) const TASK_MASK: i128 = !(1 << IS_LOCAL_SHIFT);
#[cfg(target_pointer_width = "64")]
pub(crate) const IS_LOCAL_MASK: i128 = 1 << IS_LOCAL_SHIFT;
#[derive(Clone, Copy, Debug)]
pub struct Locality {
#[cfg(not(target_pointer_width = "64"))]
pub(crate) value: bool,
#[cfg(target_pointer_width = "64")]
pub(crate) value: i128,
}
impl Locality {
#[inline(always)]
pub fn local() -> Self {
#[cfg(not(target_pointer_width = "64"))]
{
Self { value: true }
}
#[cfg(target_pointer_width = "64")]
Self {
value: IS_LOCAL_MASK,
}
}
#[inline(always)]
pub fn shared() -> Self {
#[cfg(not(target_pointer_width = "64"))]
{
Self { value: false }
}
#[cfg(target_pointer_width = "64")]
Self { value: 0 }
}
#[inline(always)]
pub fn is_local(&self) -> bool {
#[cfg(not(target_pointer_width = "64"))]
{
self.value
}
#[cfg(target_pointer_width = "64")]
{
self.value != 0
}
}
}