pub fn allocate(&mut self, amount: usize) -> Option<Memory<'heap>> {
        self.free_list.allocate(ceil_to(amount, BLOCK_SIZE_BYTES)).map(|mut m| {
            let color = if self.phase == Phase::MARKING { Color::Check } else { self.current_color };
            self.color_map.set_range(self.block_range_of(&m, color));
            if self.phase == Phase::MARKING {
                self.add_to_check_span(m.start());
            }
            m.clear();
            m
        })
    }
/// Request a `amount` bytes of memory. The size will be rounded up to
/// a multiple of the block size. Returns `None` if a block of memory
/// that big isn't available,
Request a `amount` bytes of memory. The size will be rounded up to
a multiple of the block size. Returns `None` if a block of memory
that big isn't available.
Request a ` amount ` bytes of memory . The size will be rounded up to a multiple of the block size . Returns ` None ` if a block of memory that big isn ' t available .
pub fn allocate(&mut self, amount: usize) -> Option<Memory<'heap>> {
        self.free_list.allocate(ceil_to(amount, BLOCK_SIZE_BYTES)).map(|mut m| {
            let color = if self.phase == Phase::MARKING { Color::Check } else { self.current_color };
            self.color_map.set_range(self.block_range_of(&m, color));
            if self.phase == Phase::MARKING {
                self.add_to_check_span(m.start());
            }
            m.clear();
            m
        })
    }
pub fn allocate ( & mut self , amount : usize ) -> Option < Memory < ' heap > > { self . free_list . allocate ( ceil_to ( amount , BLOCK_SIZE_BYTES ) ) . map ( | mut m | { let color = if self . phase == Phase :: MARKING { Color :: Check } else { self . current_color } ; self . color_map . set_range ( self . block_range_of ( & m , color ) ) ; if self . phase == Phase :: MARKING { self . add_to_check_span ( m . start ( ) ) ; } m . clear ( ) ; m } ) }
Request a `amount` bytes of memory.
Request a ` amount ` bytes of memory .
&mut self
amount
usize
&mut self
amount
usize