Struct allocators::Block [] [src]

pub struct Block<'a> {
    // some fields omitted
}

A block of memory created by an allocator.

Methods

impl<'a> Block<'a>

fn new(ptr: *mut u8, size: usize, align: usize) -> Self

Create a new block from the supplied parts. The pointer cannot be null.

Panics

Panics if the pointer passed is null.

fn empty() -> Self

Creates an empty block.

fn ptr(&self) -> *mut u8

Get the pointer from this block.

fn size(&self) -> usize

Get the size of this block.

fn align(&self) -> usize

Get the align of this block.

fn is_empty(&self) -> bool

Whether this block is empty.