fn enter_sweep_phase(&mut self) {
        COLLECTOR_PHASE.lock().update(CollectorPhase::Sweeping);

        let dummy_vptr = {
            let dummy = &crate::gc::GcDummyDrop {};
            let fatptr: &dyn Drop = &*dummy;
            unsafe { transmute::<*const dyn Drop, (usize, *mut u8)>(fatptr).1 }
        };

        for block in ALLOCATOR.iter() {
            if block.header().metadata().is_gc && block.colour() == Colour::White {
                if block.drop_vptr() != dummy_vptr {
                    self.drop_queue.push(block);
                    continue;
                }

                // Since we are certain that T has no need for finalization, we
                // can just dealloc it in-place. We also do not need to provide
                // a legitimate layout, as we use System alloc/dealloc calls
                // which require only the base pointer.
                unsafe { block.dealloc(Layout::new::<usize>()) };
            }
        }
    }
/// The entry-point to the sweep phase.
///
/// It is assumed that the sweep phase happens immediately after marking.
/// All white objects (i.e. objects which were not marked) are deallocated.
///
/// If this method is called without the marking phase being called first,
/// then all gc-managed objects are presumed dead and deallocated.
The entry-point to the sweep phase.
It is assumed that the sweep phase happens immediately after marking.
All white objects  are deallocated.

If this method is called without the marking phase being called first,
then all gc-managed objects are presumed dead and deallocated.
The entry - point to the sweep phase . It is assumed that the sweep phase happens immediately after marking . All white objects are deallocated . If this method is called without the marking phase being called first then all gc - managed objects are presumed dead and deallocated .
fn enter_sweep_phase(&mut self) {
        COLLECTOR_PHASE.lock().update(CollectorPhase::Sweeping);
        let dummy_vptr = {
            let dummy = &crate::gc::GcDummyDrop {};
            let fatptr: &dyn Drop = &*dummy;
            unsafe { transmute::<*const dyn Drop, (usize, *mut u8)>(fatptr).1 }
        };
        for block in ALLOCATOR.iter() {
            if block.header().metadata().is_gc && block.colour() == Colour::White {
                if block.drop_vptr() != dummy_vptr {
                    self.drop_queue.push(block);
                    continue;
                }
                // Since we are certain that T has no need for finalization, we
                // can just dealloc it in-place. We also do not need to provide
                // a legitimate layout, as we use System alloc/dealloc calls
                // which require only the base pointer.
                unsafe { block.dealloc(Layout::new::<usize>()) };
            }
        }
    }
fn enter_sweep_phase ( & mut self ) { COLLECTOR_PHASE . lock ( ) . update ( CollectorPhase :: Sweeping ) ; let dummy_vptr = { let dummy = & crate :: gc :: GcDummyDrop { } ; let fatptr : & dyn Drop = & * dummy ; unsafe { transmute :: < * const dyn Drop , ( usize , * mut u8 ) > ( fatptr ) . 1 } } ; for block in ALLOCATOR . iter ( ) { if block . header ( ) . metadata ( ) . is_gc && block . colour ( ) == Colour :: White { if block . drop_vptr ( ) != dummy_vptr { self . drop_queue . push ( block ) ; continue ; } // Since we are certain that T has no need for finalization, we // can just dealloc it in-place. We also do not need to provide // a legitimate layout, as we use System alloc/dealloc calls // which require only the base pointer. unsafe { block . dealloc ( Layout :: new :: < usize > ( ) ) } ; } } }
The entry-point to the sweep phase.
The entry - point to the sweep phase .
&mut self