pub const fn new(object_size: usize, region_pages: PageCount) -> Pool {
        assert!(object_size > 0);
        assert!(region_pages > 0);

        let config = PoolConfig {
            object_size,
            region_pages,
        };

        assert!(config.region_info_offset() > 0);

        Pool {
            config,
            objects_used: AtomicUsize::new(0),
            objects_capacity: AtomicUsize::new(0),
            free_list: AtomicPtr::new(ptr::null_mut()),
            all_list: AtomicPtr::new(ptr::null_mut()),
            maintenance_guard: Spinlock::new(()),
        }
    }
/// Create a new, empty pool.
///
/// No allocation is performed. You need to add pages to the pool before any
/// object allocation can happen within it.
Create a new, empty pool.
No allocation is performed. You need to add pages to the pool before any
object allocation can happen within it.
Create a new empty pool . No allocation is performed . You need to add pages to the pool before any object allocation can happen within it .
pub const fn new(object_size: usize, region_pages: PageCount) -> Pool {
        assert!(object_size > 0);
        assert!(region_pages > 0);
        let config = PoolConfig {
            object_size,
            region_pages,
        };
        assert!(config.region_info_offset() > 0);
        Pool {
            config,
            objects_used: AtomicUsize::new(0),
            objects_capacity: AtomicUsize::new(0),
            free_list: AtomicPtr::new(ptr::null_mut()),
            all_list: AtomicPtr::new(ptr::null_mut()),
            maintenance_guard: Spinlock::new(()),
        }
    }
pub const fn new ( object_size : usize , region_pages : PageCount ) -> Pool { assert ! ( object_size 0 ) ; assert ! ( region_pages 0 ) ; let config = PoolConfig { object_size , region_pages , } ; assert ! ( config region_info_offset ( ) 0 ) ; Pool { config , objects_used : AtomicUsize :: new ( 0 ) , objects_capacity : AtomicUsize :: new ( 0 ) , free_list : AtomicPtr :: new ( ptr :: null_mut ( ) ) , all_list : AtomicPtr :: new ( ptr :: null_mut ( ) ) , maintenance_guard : Spinlock :: new ( ( ) ) , } }
Create a new, empty pool.
Create a new empty pool .
object_size
usize
region_pages
PageCount