fn alloc_new_slab(&mut self, space_manager: &mut SpaceManager) -> *mut u8 {
        let start_offset = self.start_offset + self.color as u32;
        self.color += self.alignment as u16;
        if self.color > self.max_color {
            self.color = 0;
        }

        // Create a new slab to allocate from. This will become a partial slab.
        if let Some(slab) = space_manager.create_free_slab(
            self.slab_order as usize,
            start_offset,
            self.slots_count,
            self.obj_size,
        ) {
            let result = slab.alloc();

            // There were no partial or free slabs, otherwise we would've allocated from there.
            self.partial = SlabLink(NonNull::new(slab));

            result
        } else {
            null_mut()
        }
    }
/// Create a new slab and allocate from there.
Create a new slab and allocate from there.
Create a new slab and allocate from there .
fn alloc_new_slab(&mut self, space_manager: &mut SpaceManager) -> *mut u8 {
        let start_offset = self.start_offset + self.color as u32;
        self.color += self.alignment as u16;
        if self.color > self.max_color {
            self.color = 0;
        }
        // Create a new slab to allocate from. This will become a partial slab.
        if let Some(slab) = space_manager.create_free_slab(
            self.slab_order as usize,
            start_offset,
            self.slots_count,
            self.obj_size,
        ) {
            let result = slab.alloc();
            // There were no partial or free slabs, otherwise we would've allocated from there.
            self.partial = SlabLink(NonNull::new(slab));
            result
        } else {
            null_mut()
        }
    }
fn alloc_new_slab ( & mut self , space_manager : & mut SpaceManager ) -> * mut u8 { let start_offset = self . start_offset + self . color as u32 ; self . color += self . alignment as u16 ; if self . color > self . max_color { self . color = 0 ; } // Create a new slab to allocate from. This will become a partial slab. if let Some ( slab ) = space_manager . create_free_slab ( self . slab_order as usize , start_offset , self . slots_count , self . obj_size , ) { let result = slab . alloc ( ) ; // There were no partial or free slabs, otherwise we would've allocated from there. self . partial = SlabLink ( NonNull :: new ( slab ) ) ; result } else { null_mut ( ) } }
Create a new slab and allocate from there.
Create a new slab and allocate from there .
&mut self
space_manager
&mut SpaceManager
&mut self
space_manager
&mut SpaceManager