Merge branch 'null-stream-safety' of https://github.com/adri326/scryer-prolog into adri326-null-stream-safety

This commit is contained in:
Mark Thom
2025-04-29 23:32:48 -07:00
8 changed files with 290 additions and 126 deletions

View File

@@ -175,6 +175,7 @@ macro_rules! raw_ptr_as_cell {
// TODO use <*{const,mut} _>::addr instead of as when the strict_provenance feature is stable rust-lang/rust#95228
// we might need <*{const,mut} _>::expose_provenance for strict provenance, dependening on how we recreate a pointer later
let ptr : *const _ = $ptr;
debug_assert!(!$ptr.is_null());
HeapCellValue::from_ptr_addr(ptr as usize)
}};
}
@@ -217,12 +218,6 @@ macro_rules! string_as_pstr_cell {
}};
}
macro_rules! stream_as_cell {
($ptr:expr) => {
raw_ptr_as_cell!($ptr.as_ptr())
};
}
macro_rules! cell_as_stream {
($cell:expr) => {{
let ptr = cell_as_untyped_arena_ptr!($cell);