allocate floats in dedicated buffer

This commit is contained in:
Mark Thom
2022-04-04 23:56:30 -06:00
parent 0ab928063e
commit 8c99d748e2
14 changed files with 204 additions and 195 deletions

View File

@@ -14,8 +14,6 @@ use crate::machine::stack::*;
use crate::parser::ast::*;
use crate::parser::rug::{Integer, Rational};
use ordered_float::*;
use indexmap::IndexSet;
use std::cmp::Ordering;
@@ -673,7 +671,7 @@ impl MachineState {
pub fn unify_f64(&mut self, f1: F64Ptr, value: HeapCellValue) {
if let Some(r) = value.as_var() {
self.bind(r, typed_arena_ptr_as_cell!(f1));
self.bind(r, HeapCellValue::from(f1));
return;
}
@@ -681,16 +679,6 @@ impl MachineState {
(HeapCellValueTag::F64, f2) => {
self.fail = **f1 != **f2;
}
(HeapCellValueTag::Cons, cons_ptr) => {
match_untyped_arena_ptr!(cons_ptr,
(ArenaHeaderTag::F64, f2) => {
self.fail = **f1 != **F64Ptr(f2);
}
_ => {
self.fail = true;
}
);
}
_ => {
self.fail = true;
}