/// A usize where the top bit is used as a marked indicator.1#[derive(Copy, Clone, PartialEq, Eq, Hash)]2pub struct MarkedUsize(usize);34impl MarkedUsize {5pub const UNMARKED_MAX: usize = ((1 << (usize::BITS - 1)) - 1);67#[inline(always)]8pub const fn new(idx: usize, marked: bool) -> Self {9debug_assert!(idx >> (usize::BITS - 1) == 0);10Self(idx | ((marked as usize) << (usize::BITS - 1)))11}1213#[inline(always)]14pub fn to_usize(&self) -> usize {15self.0 & Self::UNMARKED_MAX16}1718#[inline(always)]19pub fn marked(&self) -> bool {20(self.0 >> (usize::BITS - 1)) != 021}22}232425