// copy all references from old- into young-generation.
copy all references from old- into young-generation.
copy all references from old - into young - generation .
fn copy_dirty_cards(&mut self) {
        self.card_table
            .visit_dirty_in_old(self.old_end, |card_idx| {
                let crossing_entry = self.crossing_map.get(card_idx);
                let card_start = self.card_table.to_address(card_idx);
                match crossing_entry {
                    CrossingEntry::NoRefs => panic!("card dirty without any refs"),
                    CrossingEntry::LeadingRefs(refs) => {
                        let mut ref_to_young_gen = false;
                        // copy references at start of card
                        let first_object =
                            self.copy_refs(card_start, refs as usize, &mut ref_to_young_gen);
                        // copy all objects from this card
                        self.copy_old_card(card_idx, first_object, ref_to_young_gen);
                    }
                    CrossingEntry::FirstObject(offset) => {
                        let ptr = card_start.offset(offset as usize * mem::ptr_width_usize());
                        // copy all objects from this card
                        self.copy_old_card(card_idx, ptr, false);
                    }
                    CrossingEntry::ArrayStart(offset) => {
                        assert!(offset == 1);
                        let ptr =
                            card_start.to_usize() - (offset as usize * mem::ptr_width_usize());
                        // copy all objects from this card
                        self.copy_old_card(card_idx, ptr.into(), false);
                    }
                }
            });
    }
fn copy_dirty_cards ( & mut self ) { self . card_table . visit_dirty_in_old ( self . old_end , | card_idx | { let crossing_entry = self . crossing_map . get ( card_idx ) ; let card_start = self . card_table . to_address ( card_idx ) ; match crossing_entry { CrossingEntry :: NoRefs => panic ! ( " " ) , CrossingEntry :: LeadingRefs ( refs ) => { let mut ref_to_young_gen = false ; // copy references at start of card let first_object = self . copy_refs ( card_start , refs as usize , & mut ref_to_young_gen ) ; // copy all objects from this card self . copy_old_card ( card_idx , first_object , ref_to_young_gen ) ; } CrossingEntry :: FirstObject ( offset ) => { let ptr = card_start . offset ( offset as usize * mem :: ptr_width_usize ( ) ) ; // copy all objects from this card self . copy_old_card ( card_idx , ptr , false ) ; } CrossingEntry :: ArrayStart ( offset ) => { assert ! ( offset 1 ) ; let ptr = card_start . to_usize ( ) - ( offset as usize * mem :: ptr_width_usize ( ) ) ; // copy all objects from this card self . copy_old_card ( card_idx , ptr . into ( ) , false ) ; } } } ) ; }
copy all references from old- into young-generation.
copy all references from old - into young - generation .
&mut self