fn next(&mut self) -> Option<Self::Item> {
        if self.current >= self.heap.end { return None }

        if let Some(free) = self.free_list_span.ptr.ptr {
            // did they insert a new free item behind us when we gave out the last span?
            if free.start() < self.current {
                self.free_list_span = self.free_list_span.next().unwrap();
                return self.next();
            }

            if free.start() == self.current {
                let free_span: FreeListSpan<'a> = self.free_list_span;
                // there is always at least one span, because the final null pointer
                // is yielded. we stop calling `next()` at that point, so we never
                // get to the `None` end of the iteration.
                self.free_list_span = free_span.next().unwrap();
                self.current = free.end();
                return Some(HeapSpan::from_free_block(free, free_span));
            }
        }

        let span = self.heap.get_range(self.current);
        self.current = self.heap.address_of(span.end);
        Some(HeapSpan::from_block_range(self.heap, span, self.free_list_span))
    }
// tricky: there are two lists to traverse in tandem. if the current
// pointer is the next in the free list, that takes precedence.
// otherwise, use the block map.
there are two lists to traverse in tandem. if the current
pointer is the next in the free list, that takes precedence.
otherwise, use the block map.
there are two lists to traverse in tandem . if the current pointer is the next in the free list that takes precedence . otherwise use the block map .
fn next(&mut self) -> Option<Self::Item> {
        if self.current >= self.heap.end { return None }
        if let Some(free) = self.free_list_span.ptr.ptr {
            // did they insert a new free item behind us when we gave out the last span?
            if free.start() < self.current {
                self.free_list_span = self.free_list_span.next().unwrap();
                return self.next();
            }
            if free.start() == self.current {
                let free_span: FreeListSpan<'a> = self.free_list_span;
                // there is always at least one span, because the final null pointer
                // is yielded. we stop calling `next()` at that point, so we never
                // get to the `None` end of the iteration.
                self.free_list_span = free_span.next().unwrap();
                self.current = free.end();
                return Some(HeapSpan::from_free_block(free, free_span));
            }
        }
        let span = self.heap.get_range(self.current);
        self.current = self.heap.address_of(span.end);
        Some(HeapSpan::from_block_range(self.heap, span, self.free_list_span))
    }
fn next ( & mut self ) -> Option < Self :: Item > { if self . current >= self . heap . end { return None } if let Some ( free ) = self . free_list_span . ptr . ptr { // did they insert a new free item behind us when we gave out the last span? if free . start ( ) < self . current { self . free_list_span = self . free_list_span . next ( ) . unwrap ( ) ; return self . next ( ) ; } if free . start ( ) == self . current { let free_span : FreeListSpan < ' a > = self . free_list_span ; // there is always at least one span, because the final null pointer // is yielded. we stop calling `next()` at that point, so we never // get to the `None` end of the iteration. self . free_list_span = free_span . next ( ) . unwrap ( ) ; self . current = free . end ( ) ; return Some ( HeapSpan :: from_free_block ( free , free_span ) ) ; } } let span = self . heap . get_range ( self . current ) ; self . current = self . heap . address_of ( span . end ) ; Some ( HeapSpan :: from_block_range ( self . heap , span , self . free_list_span ) ) }
tricky: there are two lists to traverse in tandem.
tricky : there are two lists to traverse in tandem .
&mut self
&mut self