Trait method lrs::alloc::Allocator::allocate

Allocates an object of the specified type.

Syntax

unsafe fn allocate<T>(pool: &mut <Self as Allocator>::Pool) -> Result<*mut T, Errno>

Arguments

NameDescription
pool

The pool from which to draw memory.

Return value

Returns a pointer to an allocated object.

Remarks

If T has size 0, a call to this function behaves like a call to empty_ptr.