pub fn for_each_ordered<'a>(&'a mut self, mut f: impl FnMut(&'a AValuePtr)) {
        // It seems that we get the chunks from most newest to oldest.
        // And within each chunk, the values are filled newest to oldest.
        // So need to do two sets of reversing.
        let chunks = self.drop.iter_allocated_chunks().collect::<Vec<_>>();
        // Use a single buffer to reduce allocations, but clear it after use
        let mut buffer = Vec::new();
        for chunk in chunks.iter().rev() {
            Self::iter_chunk(chunk, |x| buffer.push(x));
            buffer.iter().rev().for_each(|x| f(*x));
            buffer.clear();
        }
    }
// Iterate over the values in the heap in the order they
// were added.
// Requires relying on internal bumpalo invariants, since
// there is no spec to the resulting order.
Iterate over the values in the heap in the order they
were added.
Requires relying on internal bumpalo invariants, since
there is no spec to the resulting order.
Iterate over the values in the heap in the order they were added . Requires relying on internal bumpalo invariants since there is no spec to the resulting order .
pub fn for_each_ordered<'a>(&'a mut self, mut f: impl FnMut(&'a AValuePtr)) {
        // It seems that we get the chunks from most newest to oldest.
        // And within each chunk, the values are filled newest to oldest.
        // So need to do two sets of reversing.
        let chunks = self.drop.iter_allocated_chunks().collect::<Vec<_>>();
        // Use a single buffer to reduce allocations, but clear it after use
        let mut buffer = Vec::new();
        for chunk in chunks.iter().rev() {
            Self::iter_chunk(chunk, |x| buffer.push(x));
            buffer.iter().rev().for_each(|x| f(*x));
            buffer.clear();
        }
    }
pub fn for_each_ordered < ' a > ( & ' a mut self , mut f : impl FnMut ( & ' a AValuePtr ) ) { // It seems that we get the chunks from most newest to oldest. // And within each chunk, the values are filled newest to oldest. // So need to do two sets of reversing. let chunks = self . drop . iter_allocated_chunks ( ) . collect :: < Vec < _ > > ( ) ; // Use a single buffer to reduce allocations, but clear it after use let mut buffer = Vec :: new ( ) ; for chunk in chunks . iter ( ) . rev ( ) { Self :: iter_chunk ( chunk , | x | buffer . push ( x ) ) ; buffer . iter ( ) . rev ( ) . for_each ( | x | f ( * x ) ) ; buffer . clear ( ) ; } }
Iterate over the values in the heap in the order they
were added.
Iterate over the values in the heap in the order they were added .
&'a mut self
f
impl FnMut(&'a AValuePtr)
&'a mut self
f
impl FnMut(&'a AValuePtr)