introduce CutPoint heap tag so that they can be offset by call_continuation/1

This commit is contained in:
Mark
2023-06-29 12:14:06 -06:00
parent 83f352b95e
commit c36bd4dc07
7 changed files with 54 additions and 21 deletions

View File

@@ -493,6 +493,15 @@ impl Fixnum {
.with_f(false)
}
#[inline]
pub fn as_cutpoint(num: i64) -> Self {
Fixnum::new()
.with_num(u64::from_ne_bytes(num.to_ne_bytes()) & ((1 << 56) - 1))
.with_tag(HeapCellValueTag::CutPoint as u8)
.with_m(false)
.with_f(false)
}
#[inline]
pub fn build_with_checked(num: i64) -> Result<Self, OutOfBounds> {
const UPPER_BOUND: i64 = (1 << 55) - 1;