pub fn init(&mut self, base: u64, size: usize) {
        let mut idx = get_idx(size);
        if 1 << idx > size {
            idx -= 1;
        }
        self.buddies = [u64::MAX; 64];
        self.size = 1 << idx;
        self.available = self.size;
        self.buddies[idx] = base;
        self.last_idx = idx;
        self.log64.clear();
        self.drop_log.clear();
        self.aux.clear();

        Self::buddy(base).next = u64::MAX;

        #[cfg(not(any(feature = "no_pthread", windows)))] unsafe {
        crate::sync::init_lock(&mut self.mutex.0, &mut self.mutex.1);
        }

        #[cfg(any(feature = "no_pthread", windows))] {
        self.mutex = 0; }
    }
/// Pool Initialization with a given device size
Pool Initialization with a given device size
Pool Initialization with a given device size
pub fn init(&mut self, base: u64, size: usize) {
        let mut idx = get_idx(size);
        if 1 << idx > size {
            idx -= 1;
        }
        self.buddies = [u64::MAX; 64];
        self.size = 1 << idx;
        self.available = self.size;
        self.buddies[idx] = base;
        self.last_idx = idx;
        self.log64.clear();
        self.drop_log.clear();
        self.aux.clear();
        Self::buddy(base).next = u64::MAX;
        #[cfg(not(any(feature = "no_pthread", windows)))] unsafe {
        crate::sync::init_lock(&mut self.mutex.0, &mut self.mutex.1);
        }
        #[cfg(any(feature = "no_pthread", windows))] {
        self.mutex = 0; }
    }
pub fn init ( & mut self , base : u64 , size : usize ) { let mut idx = get_idx ( size ) ; if 1 << idx > size { idx -= 1 ; } self . buddies = [ u64 :: MAX ; 64 ] ; self . size = 1 << idx ; self . available = self . size ; self . buddies [ idx ] = base ; self . last_idx = idx ; self . log64 . clear ( ) ; self . drop_log . clear ( ) ; self . aux . clear ( ) ; Self :: buddy ( base ) . next = u64 :: MAX ; # [ cfg ( not ( any ( feature " " windows ) ) ) ] unsafe { crate :: sync :: init_lock ( & mut self . mutex . 0 , & mut self . mutex . 1 ) ; } # [ cfg ( any ( feature " " windows ) ) ] { self . mutex = 0 ; } }
Pool Initialization with a given device size
Pool Initialization with a given device size
&mut self
base
u64
size
usize