Struct itron_asp3::memorypool::MemoryPool [−][src]
pub struct MemoryPool(_);
This is supported on crate features
unstable
and dcre
only.Expand description
An owned memory pool.
Deletes the memory pool automatically when dropped. The destructor will panic if the deletion fails.
Implementations
acre_mpf
: Create a builder for MemoryPool
.
Examples
use itron::memorypool::MemoryPool;
let pool = MemoryPool::build()
.block_size(32)
.block_count(4)
.finish()
.expect("failed to create a memory pool");
let block = pool.as_ref().get()
.expect("failed to allocate a block");
pool.as_ref().release(block)
.expect("failed to deallocate a block");
Consume and “leak” self
, returning a reference MemoryPoolRef<'a>
.
Get the raw object ID as abi::NonNullID
.
Borrow MemoryPool
as MemoryPoolRef
.
Use this to perform operations on memory pools because most of the
methods are implemented on MemoryPoolRef
but not MemoryPool
.
Trait Implementations
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.