pub(crate) unsafe fn recover(&mut self, rollback: bool, 
        #[cfg(feature = "check_double_free")]
        check_double_free: &mut HashSet<u64>
    ) {
        match &mut self.0 {
            DataLog(src, log, layout) => {
                if rollback {
                    debug_assert!(A::allocated(*src, 1), "Access Violation at address 0x{:x}", *src);
                    debug_assert!(A::allocated(*log, 1), "Access Violation at address 0x{:x}", *log);
                    Self::rollback_datalog(src, log, layout);
                    self.notify(0);
                    self.1 = Notifier::None;
                    
                    #[cfg(feature = "check_allocator_cyclic_links")]
                    debug_assert!(A::verify());
                }
            }
            DropOnFailure(src, len) => {
                if rollback {
                    if *src != u64::MAX {
                        #[cfg(feature = "check_double_free")] {
                            if check_double_free.contains(&*src) {
                                return;
                            }
                            check_double_free.insert(*src);
                        }
                        debug_assert!(A::allocated(*src, 1), "Access Violation (0x{:x})", *src);
                        let z = A::pre_dealloc(A::get_mut_unchecked(*src), *len);
                        A::log64(A::off_unchecked(src), u64::MAX, z);
                        A::perform(z);
                    
                        #[cfg(feature = "check_allocator_cyclic_links")]
                        debug_assert!(A::verify());
                    }
                }
            }
            RecountOnFailure(src, inc) => {
                let off = *src;
                if off != u64::MAX {
                    debug_assert!(A::allocated(off, 1), "Access Violation (0x{:x}))", off);
                    let c = A::get_mut_unchecked::<u64>(off);
                    let z = A::zone(off);
                    A::prepare(z);
                    if *c != u64::MAX {
                        if *inc {
                            A::log64(off, *c as u64 + 1, z);
                        } else {
                            A::log64(off, *c as u64 - 1, z);
                        }
                    }
                    A::log64(A::off_unchecked(src), u64::MAX, z);
                    A::perform(z);
                    
                    #[cfg(feature = "check_allocator_cyclic_links")]
                    debug_assert!(A::verify());
                }
            }
            UnlockOnCommit(src) => {
                *src = u64::MAX;
            }
            _ => {}
        }
    }
/// Recovers from the crash or power failure
Recovers from the crash or power failure
Recovers from the crash or power failure
pub(crate) unsafe fn recover(&mut self, rollback: bool, 
        #[cfg(feature = "check_double_free")]
        check_double_free: &mut HashSet<u64>
    ) {
        match &mut self.0 {
            DataLog(src, log, layout) => {
                if rollback {
                    debug_assert!(A::allocated(*src, 1), "Access Violation at address 0x{:x}", *src);
                    debug_assert!(A::allocated(*log, 1), "Access Violation at address 0x{:x}", *log);
                    Self::rollback_datalog(src, log, layout);
                    self.notify(0);
                    self.1 = Notifier::None;
                    #[cfg(feature = "check_allocator_cyclic_links")]
                    debug_assert!(A::verify());
                }
            }
            DropOnFailure(src, len) => {
                if rollback {
                    if *src != u64::MAX {
                        #[cfg(feature = "check_double_free")] {
                            if check_double_free.contains(&*src) {
                                return;
                            }
                            check_double_free.insert(*src);
                        }
                        debug_assert!(A::allocated(*src, 1), "Access Violation (0x{:x})", *src);
                        let z = A::pre_dealloc(A::get_mut_unchecked(*src), *len);
                        A::log64(A::off_unchecked(src), u64::MAX, z);
                        A::perform(z);
                        #[cfg(feature = "check_allocator_cyclic_links")]
                        debug_assert!(A::verify());
                    }
                }
            }
            RecountOnFailure(src, inc) => {
                let off = *src;
                if off != u64::MAX {
                    debug_assert!(A::allocated(off, 1), "Access Violation (0x{:x}))", off);
                    let c = A::get_mut_unchecked::<u64>(off);
                    let z = A::zone(off);
                    A::prepare(z);
                    if *c != u64::MAX {
                        if *inc {
                            A::log64(off, *c as u64 + 1, z);
                        } else {
                            A::log64(off, *c as u64 - 1, z);
                        }
                    }
                    A::log64(A::off_unchecked(src), u64::MAX, z);
                    A::perform(z);
                    #[cfg(feature = "check_allocator_cyclic_links")]
                    debug_assert!(A::verify());
                }
            }
            UnlockOnCommit(src) => {
                *src = u64::MAX;
            }
            _ => {}
        }
    }
pub ( crate ) unsafe fn recover ( & mut self , rollback : bool , # [ cfg ( feature " " ) ] check_double_free : & mut HashSet < u64 > ) { match & mut self . 0 { DataLog ( src , log , layout ) => { if rollback { debug_assert ! ( A allocated ( src 1 ) " " src ) ; debug_assert ! ( A allocated ( log 1 ) " " log ) ; Self :: rollback_datalog ( src , log , layout ) ; self . notify ( 0 ) ; self . 1 = Notifier :: None ; # [ cfg ( feature " " ) ] debug_assert ! ( A verify ( ) ) ; } } DropOnFailure ( src , len ) => { if rollback { if * src != u64 :: MAX { # [ cfg ( feature " " ) ] { if check_double_free . contains ( & * src ) { return ; } check_double_free . insert ( * src ) ; } debug_assert ! ( A allocated ( src 1 ) " " src ) ; let z = A :: pre_dealloc ( A :: get_mut_unchecked ( * src ) , * len ) ; A :: log64 ( A :: off_unchecked ( src ) , u64 :: MAX , z ) ; A :: perform ( z ) ; # [ cfg ( feature " " ) ] debug_assert ! ( A verify ( ) ) ; } } } RecountOnFailure ( src , inc ) => { let off = * src ; if off != u64 :: MAX { debug_assert ! ( A allocated ( off 1 ) " " off ) ; let c = A :: get_mut_unchecked :: < u64 > ( off ) ; let z = A :: zone ( off ) ; A :: prepare ( z ) ; if * c != u64 :: MAX { if * inc { A :: log64 ( off , * c as u64 + 1 , z ) ; } else { A :: log64 ( off , * c as u64 - 1 , z ) ; } } A :: log64 ( A :: off_unchecked ( src ) , u64 :: MAX , z ) ; A :: perform ( z ) ; # [ cfg ( feature " " ) ] debug_assert ! ( A verify ( ) ) ; } } UnlockOnCommit ( src ) => { * src = u64 :: MAX ; } _ => { } } }
Recovers from the crash or power failure
Recovers from the crash or power failure
&mut self
rollback
bool
check_double_free
&mut HashSet<u64>