pub fn try_insert_before(&self, m: Memory<'heap>) -> Option<Memory<'heap>> {
        let s = self.as_mut();
        if let Some(block) = s.ptr.as_mut() {
            if block.start() > m.start() {
                // insert before the current block.
                let new_block = FreeBlock::from_memory(m, *self);
                new_block.check_merge_next();
                s.ptr = Some(new_block);
                return None
            }
        }
        Some(m)
    }
// the inserts will consume the memory if it was successfully inserted,
// or return it if this isn't the right place.
the inserts will consume the memory if it was successfully inserted,
or return it if this isn't the right place.
the inserts will consume the memory if it was successfully inserted or return it if this isn ' t the right place .
pub fn try_insert_before(&self, m: Memory<'heap>) -> Option<Memory<'heap>> {
        let s = self.as_mut();
        if let Some(block) = s.ptr.as_mut() {
            if block.start() > m.start() {
                // insert before the current block.
                let new_block = FreeBlock::from_memory(m, *self);
                new_block.check_merge_next();
                s.ptr = Some(new_block);
                return None
            }
        }
        Some(m)
    }
pub fn try_insert_before ( & self , m : Memory < ' heap > ) -> Option < Memory < ' heap > > { let s = self . as_mut ( ) ; if let Some ( block ) = s . ptr . as_mut ( ) { if block . start ( ) > m . start ( ) { // insert before the current block. let new_block = FreeBlock :: from_memory ( m , * self ) ; new_block . check_merge_next ( ) ; s . ptr = Some ( new_block ) ; return None } } Some ( m ) }
the inserts will consume the memory if it was successfully inserted,
or return it if this isn't the right place.
the inserts will consume the memory if it was successfully inserted or return it if this isn ' t the right place .
&self
m
Memory<'heap>
&self
m
Memory<'heap>