Err(_) => {}
}
- let indices = (0..visitor.static_strs.len()).map(|i| i << 3);
+ let indices = (0..visitor.static_strs.len()).map(|i| (i << 3) as u64);
let indices_iter = indices.clone();
let static_strs_len = visitor.static_strs.len();
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
pub struct Atom {
- pub index: usize,
+ pub index: u64,
}
const_assert!(mem::size_of::<Atom>() == 8);
#[inline(always)]
pub fn is_static(self) -> bool {
- self.index < STRINGS.len() << 3
+ (self.index as usize) < STRINGS.len() << 3
}
#[inline(always)]
if self.is_static() {
ptr::null()
} else {
- (get_atom_tbl_buf_base() as usize + self.index - (STRINGS.len() << 3)) as *const u8
+ (get_atom_tbl_buf_base() as usize + (self.index as usize) - (STRINGS.len() << 3)) as *const u8
}
}
#[inline(always)]
pub fn from(index: usize) -> Self {
- Self { index }
+ Self { index: index as u64 }
}
#[inline(always)]
pub fn len(self) -> usize {
if self.is_static() {
- STRINGS[self.index >> 3].len()
+ STRINGS[(self.index >> 3) as usize].len()
} else {
unsafe { ptr::read(self.as_ptr() as *const AtomHeader).len() as _ }
}
let ptr = self.as_ptr();
if ptr.is_null() {
- return STRINGS[self.index >> 3];
+ return STRINGS[(self.index >> 3) as usize];
}
let header = ptr::read::<AtomHeader>(ptr as *const _);
write_to_ptr(string, len_ptr);
let atom = Atom {
- index: (STRINGS.len() << 3) + len_ptr as usize - ptr_base,
+ index: ((STRINGS.len() << 3) + len_ptr as usize - ptr_base) as u64,
};
self.table.insert(atom);
impl Default for BranchNumber {
fn default() -> Self {
Self {
- branch_num: Rational::from(1usize << 63),
+ branch_num: Rational::from(1u64 << 63),
delta: Rational::from(1),
}
}