detect all cycles in roughly linear time and constant space (#2102)
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
pub(crate) use crate::machine::gc::{CycleDetectorUMP, IteratorUMP, StacklessPreOrderHeapIter};
|
||||
#[cfg(test)]
|
||||
pub(crate) use crate::machine::gc::{IteratorUMP};
|
||||
pub(crate) use crate::machine::gc::{CycleDetectorUMP, StacklessPreOrderHeapIter};
|
||||
|
||||
use crate::atom_table::*;
|
||||
use crate::machine::heap::*;
|
||||
@@ -503,6 +505,7 @@ impl<'a, ElideLists: ListElisionPolicy> Iterator for StackfulPreOrderHeapIter<'a
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
#[inline(always)]
|
||||
pub(crate) fn stackless_preorder_iter(
|
||||
heap: &mut Vec<HeapCellValue>,
|
||||
@@ -1265,7 +1268,6 @@ mod tests {
|
||||
list_loc_as_cell!(1)
|
||||
);
|
||||
|
||||
assert_eq!(iter.next().unwrap(), list_loc_as_cell!(1));
|
||||
assert_eq!(iter.next(), None);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user