pub unsafe fn insert_region(&self, addr: usize) -> Result<(), Error> {
        assert!(addr > 0);

        initialize_region(addr, self.config);

        let region_info = RegionInfoRef::new(ptr::NonNull::new(
            (addr + self.config.region_info_offset() as usize)
                as *mut RegionInfo,
        )
        .unwrap());

        push(&self.all_list, region_info.clone(), ListSel::All);
        push(&self.free_list, region_info, ListSel::Free);

        self.objects_capacity.fetch_add(self.config.object_capacity(), Relaxed);

        trace!("pool({}) region inserted: {:016x}, new capacity = {}/{}",
            self.object_size(), addr,
            self.objects_used(), self.objects_capacity());

        Ok(())
    }
/// Make a region available to the pool.
///
/// # Unsafety
///
/// The region is presumed to be mapped and available, up to the page size
/// specified by [region_pages]. It will be initialized as free.
///
/// We also assume the region hasn't already been inserted. Inserting the
/// same region more than once before removing it first is undefined.
Make a region available to the pool.
Make a region available to the pool .
pub unsafe fn insert_region(&self, addr: usize) -> Result<(), Error> {
        assert!(addr > 0);
        initialize_region(addr, self.config);
        let region_info = RegionInfoRef::new(ptr::NonNull::new(
            (addr + self.config.region_info_offset() as usize)
                as *mut RegionInfo,
        )
        .unwrap());
        push(&self.all_list, region_info.clone(), ListSel::All);
        push(&self.free_list, region_info, ListSel::Free);
        self.objects_capacity.fetch_add(self.config.object_capacity(), Relaxed);
        trace!("pool({}) region inserted: {:016x}, new capacity = {}/{}",
            self.object_size(), addr,
            self.objects_used(), self.objects_capacity());
        Ok(())
    }
pub unsafe fn insert_region ( & self , addr : usize ) -> Result < ( ) , Error > { assert ! ( addr 0 ) ; initialize_region ( addr , self . config ) ; let region_info = RegionInfoRef :: new ( ptr :: NonNull :: new ( ( addr + self . config . region_info_offset ( ) as usize ) as * mut RegionInfo , ) . unwrap ( ) ) ; push ( & self . all_list , region_info . clone ( ) , ListSel :: All ) ; push ( & self . free_list , region_info , ListSel :: Free ) ; self . objects_capacity . fetch_add ( self . config . object_capacity ( ) , Relaxed ) ; trace ! ( " " self object_size ( ) addr self objects_used ( ) self objects_capacity ( ) ) ; Ok ( ( ) ) }
Make a region available to the pool.
Make a region available to the pool .
&self
addr
usize
unsafety
The region is presumed to be mapped and available, up to the page size
specified by [region_pages]. It will be initialized as free.

We also assume the region hasn't already been inserted. Inserting the
same region more than once before removing it first is undefined.
The region is presumed to be mapped and available up to the page size specified by [ region_pages ] . It will be initialized as free . We also assume the region hasn ' t already been inserted . Inserting the same region more than once before removing it first is undefined .