From: Markus Triska Date: Tue, 19 May 2020 15:02:15 +0000 (+0200) Subject: use more fixnums in cryptographic routines X-Git-Tag: v0.8.123~11^2~2 X-Git-Url: https://git.sagredo.dev/?a=commitdiff_plain;h=34f7752c0f864218e0530e85563a3a3bfe80dc76;p=scryer-prolog.git use more fixnums in cryptographic routines --- diff --git a/src/prolog/machine/system_calls.rs b/src/prolog/machine/system_calls.rs index fe90950d..1fd341c0 100644 --- a/src/prolog/machine/system_calls.rs +++ b/src/prolog/machine/system_calls.rs @@ -5252,7 +5252,7 @@ impl MachineState { _ => { unreachable!() } }, &bytes); - Addr::HeapCell(self.heap.to_list(ints.as_ref().iter().map(|b| HeapCellValue::Integer(Rc::new(Integer::from(*b)))))) + Addr::HeapCell(self.heap.to_list(ints.as_ref().iter().map(|b| HeapCellValue::from(Addr::Fixnum(*b as isize))))) } }; @@ -5308,7 +5308,7 @@ impl MachineState { _ => { self.fail = true; return Ok(()); } } - Addr::HeapCell(self.heap.to_list(bytes.iter().map(|b| HeapCellValue::Integer(Rc::new(Integer::from(*b)))))) + Addr::HeapCell(self.heap.to_list(bytes.iter().map(|b| HeapCellValue::from(Addr::Fixnum(*b as isize))))) }; self.unify(self[temp_v!(6)], ints_list); @@ -5341,7 +5341,7 @@ impl MachineState { NonZeroU32::new(iterations as u32).unwrap(), &salt, &data, &mut bytes); - Addr::HeapCell(self.heap.to_list(bytes.iter().map(|b| HeapCellValue::Integer(Rc::new(Integer::from(*b)))))) + Addr::HeapCell(self.heap.to_list(bytes.iter().map(|b| HeapCellValue::from(Addr::Fixnum(*b as isize))))) }; self.unify(self[temp_v!(4)], ints_list); @@ -5366,7 +5366,7 @@ impl MachineState { }; let tag_list = - Addr::HeapCell(self.heap.to_list(tag.as_ref().iter().map(|b| HeapCellValue::Integer(Rc::new(Integer::from(*b)))))); + Addr::HeapCell(self.heap.to_list(tag.as_ref().iter().map(|b| HeapCellValue::from(Addr::Fixnum(*b as isize))))); let complete_string = { let buffer = String::from_iter(in_out.iter().map(|b| *b as char));