add TrailRef type for trail

This commit is contained in:
Mark Thom
2019-01-26 20:06:27 -07:00
parent 91b85db90c
commit 6e735bc2d4
3 changed files with 49 additions and 23 deletions

View File

@@ -821,6 +821,22 @@ impl Ref {
}
}
#[derive(Clone)]
pub enum TrailRef {
HeapCell(usize),
StackCell(usize, usize),
AttrVarLink(usize, Addr)
}
impl From<Ref> for TrailRef {
fn from(r: Ref) -> Self {
match r {
Ref::HeapCell(h) => TrailRef::HeapCell(h),
Ref::StackCell(fr, sc) => TrailRef::StackCell(fr, sc)
}
}
}
#[derive(Clone, PartialEq)]
pub enum HeapCellValue {
Addr(Addr),