/// Runs destructor on objects from the top of the `Arena` to next;
Runs destructor on objects from the top of the `Arena` to next.
Runs destructor on objects from the top of the ` Arena ` to next .
unsafe fn drop_objects(&self, header: *mut HeaderUnTyped, range: DropedBounds) {
        debug_assert!(self.type_info.needs_drop);
        let GcTypeInfo { align, size, .. } = self.type_info;
        let low = if header == range.0 as _ {
            header as usize + HeaderUnTyped::low_offset(align) as usize
        } else {
            range.0 as usize + size as usize
        };
        let mut ptr = range.1 as usize;
        let drop_in_place = self.type_info.drop_in_place_fn();
        let evacuated = { &mut *header }.evacuated.lock().unwrap();
        log::trace!(
            "drop_objects(header: {:?}, range: {:?}): {:?}..={:?}",
            header,
            range,
            low as *const u8,
            ptr as *const u8
        );
        while ptr >= low {
            // TODO sort and iterate between evacuated
            if !evacuated.contains_key(&index(ptr as *const u8, size, align)) {
                // log::trace!("drop ptr: {:?}", ptr as *mut u8);
                // fn debug() {}
                // FIXME #[cfg(debug)]
                let debug = || {
                    let slots = &mut *self.slots.get();
                    let live = slots
                        .get_mut(&(ptr as _))
                        .unwrap_or_else(|| panic!("Droping invalid ptr: {:?}", ptr as *mut u8));
                    if !*live {
                        panic!("Double freeing ptr: {:?}", ptr as *mut u8);
                    } else {
                        *live = false
                    }
                };
                debug();
                drop_in_place(ptr as *mut u8)
            };
            ptr -= size as usize;
        }
    }
unsafe fn drop_objects ( & self , header : * mut HeaderUnTyped , range : DropedBounds ) { debug_assert ! ( self type_info needs_drop ) ; let GcTypeInfo { align , size , .. } = self . type_info ; let low = if header == range . 0 as _ { header as usize + HeaderUnTyped :: low_offset ( align ) as usize } else { range . 0 as usize + size as usize } ; let mut ptr = range . 1 as usize ; let drop_in_place = self . type_info . drop_in_place_fn ( ) ; let evacuated = { & mut * header } . evacuated . lock ( ) . unwrap ( ) ; log :: trace ! ( " " header range low as const u8 ptr as const u8 ) ; while ptr >= low { // TODO sort and iterate between evacuated if ! evacuated . contains_key ( & index ( ptr as * const u8 , size , align ) ) { // log::trace!("drop ptr: {:?}", ptr as *mut u8); // fn debug() {} // FIXME #[cfg(debug)] let debug = | | { let slots = & mut * self . slots . get ( ) ; let live = slots . get_mut ( & ( ptr as _ ) ) . unwrap_or_else ( | | panic ! ( " " ptr as mut u8 ) ) ; if ! * live { panic ! ( " " ptr as mut u8 ) ; } else { * live = false } } ; debug ( ) ; drop_in_place ( ptr as * mut u8 ) } ; ptr -= size as usize ; } }
Runs destructor on objects from the top of the `Arena` to next;
Runs destructor on objects from the top of the ` Arena ` to next ;
&self
header
*mut HeaderUnTyped
range
DropedBounds