interpret: make isize::MAX the limit for dynamic value sizes

This commit is contained in:
Ralf Jung 2022-03-27 19:34:16 -04:00
parent df20355fa9
commit a421cbbead
3 changed files with 15 additions and 8 deletions

View file

@ -18,6 +18,11 @@ pub trait PointerArithmetic: HasDataLayout {
self.data_layout().pointer_size
}
#[inline(always)]
fn max_size_of_val(&self) -> Size {
Size::from_bytes(self.machine_isize_max())
}
#[inline]
fn machine_usize_max(&self) -> u64 {
self.pointer_size().unsigned_int_max().try_into().unwrap()