/// Allocates a block of memory with the given size and alignment.
Allocates a block of memory with the given size and alignment.
Allocates a block of memory with the given size and alignment .
fn allocate(&mut self, size: usize, align: usize) -> Option<*mut u8> {
        let alloc_start = align_up(self.next, align);
        let alloc_end = alloc_start.saturating_add(size);
        if alloc_end <= self.heap_start + self.heap_size {
            self.next = alloc_end;
            Some(alloc_start as *mut u8)
        } else {
            None
        }
    }
fn allocate ( & mut self , size : usize , align : usize ) -> Option < * mut u8 > { let alloc_start = align_up ( self . next , align ) ; let alloc_end = alloc_start . saturating_add ( size ) ; if alloc_end <= self . heap_start + self . heap_size { self . next = alloc_end ; Some ( alloc_start as * mut u8 ) } else { None } }
Allocates a block of memory with the given size and alignment.
Allocates a block of memory with the given size and alignment .
&mut self
size
usize
align
usize