add STOP_AT_CYCLES const parameter for CycleDetectingIter

This commit is contained in:
Mark
2023-10-23 12:03:25 -06:00
parent 6a913bc4cc
commit 97b899f4a3
2 changed files with 9 additions and 7 deletions

View File

@@ -2,7 +2,7 @@
pub(crate) use crate::machine::gc::StacklessPreOrderHeapIter;
use crate::atom_table::*;
use crate::machine::cycle_detection::CycleDetectingIter;
use crate::machine::cycle_detection::*;
use crate::machine::heap::*;
use crate::machine::stack::*;
use crate::types::*;
@@ -509,7 +509,9 @@ impl<'a, ElideLists: ListElisionPolicy> Iterator for StackfulPreOrderHeapIter<'a
pub(crate) fn cycle_detecting_stackless_preorder_iter<'a>(
heap: &'a mut [HeapCellValue],
start: usize,
) -> CycleDetectingIter<'a> {
) -> CycleDetectingIter<'a, true> {
// const generics argument of true so that cycle discovery stops
// the iterator.
CycleDetectingIter::new(heap, start)
}