pub fn allocate_first_fit(&mut self, layout: Layout) -> Result<NonNull<u8>, ()> {
        match self.holes.allocate_first_fit(layout) {
            Ok((ptr, aligned_layout)) => {
                self.used += aligned_layout.size();
                Ok(ptr)
            }
            Err(err) => Err(err),
        }
    }
/// Allocates a chunk of the given size with the given alignment. Returns a pointer to the
/// beginning of that chunk if it was successful. Else it returns `None`.
/// This function scans the list of free memory blocks and uses the first block that is big
/// enough. The runtime is in O(n) where n is the number of free blocks, but it should be
/// reasonably fast for small allocations.
Allocates a chunk of the given size with the given alignment. Returns a pointer to the
beginning of that chunk if it was successful. Else it returns `None`.
This function scans the list of free memory blocks and uses the first block that is big
enough. The runtime is in O(n) where n is the number of free blocks, but it should be
reasonably fast for small allocations.
Allocates a chunk of the given size with the given alignment . Returns a pointer to the beginning of that chunk if it was successful . Else it returns ` None ` . This function scans the list of free memory blocks and uses the first block that is big enough . The runtime is in O ( n ) where n is the number of free blocks but it should be reasonably fast for small allocations .
pub fn allocate_first_fit(&mut self, layout: Layout) -> Result<NonNull<u8>, ()> {
        match self.holes.allocate_first_fit(layout) {
            Ok((ptr, aligned_layout)) => {
                self.used += aligned_layout.size();
                Ok(ptr)
            }
            Err(err) => Err(err),
        }
    }
pub fn allocate_first_fit ( & mut self , layout : Layout ) -> Result < NonNull < u8 > , ( ) > { match self . holes . allocate_first_fit ( layout ) { Ok ( ( ptr , aligned_layout ) ) => { self . used += aligned_layout . size ( ) ; Ok ( ptr ) } Err ( err ) => Err ( err ) , } }
Allocates a chunk of the given size with the given alignment.
Allocates a chunk of the given size with the given alignment .
&mut self
layout
Layout
&mut self
layout
Layout