pub fn allocate_region(&mut self, size: u64) -> Option<Region> {
        for i in 0..self.free_regions.len() {
            if size == self.free_regions[i].size {
                return Some(self.free_regions.remove(i));
            } else if size < self.free_regions[i].size {
                return Some(self.free_regions[i].take_subregion(size));
            }
        }
        None
    }
/// Find and take a region with the requested size from the free regions.
///
/// If no region is large enough, or no regions are remaining, then None is
/// returned.
Find and take a region with the requested size from the free regions.
If no region is large enough, or no regions are remaining, then None is
returned.
Find and take a region with the requested size from the free regions . If no region is large enough or no regions are remaining then None is returned .
pub fn allocate_region(&mut self, size: u64) -> Option<Region> {
        for i in 0..self.free_regions.len() {
            if size == self.free_regions[i].size {
                return Some(self.free_regions.remove(i));
            } else if size < self.free_regions[i].size {
                return Some(self.free_regions[i].take_subregion(size));
            }
        }
        None
    }
pub fn allocate_region ( & mut self , size : u64 ) -> Option < Region > { for i in 0 .. self . free_regions . len ( ) { if size == self . free_regions [ i ] . size { return Some ( self . free_regions . remove ( i ) ) ; } else if size < self . free_regions [ i ] . size { return Some ( self . free_regions [ i ] . take_subregion ( size ) ) ; } } None }
Find and take a region with the requested size from the free regions.
Find and take a region with the requested size from the free regions .
&mut self
size
u64