[][src]Struct swim_mem::alloc::AllocTag

#[repr(C)]
pub struct AllocTag<'a> { /* fields omitted */ }

Back-pointer to the Hold that allocated a block. An AllocTag immediately precedes every memory block allocated by a Hold.

Methods

impl<'a> AllocTag<'a>[src]

pub const unsafe fn null() -> AllocTag<'a>[src]

Returns a new AllocTag that points to an invalid hold address. Used as a placeholder when statically initializing fixed memory allocations. The tag is not safe to use until AllocTag::init is called with the base address of a valid Hold.

Safety

Exposing a null AllocTag can cause segmentation faults.

pub fn empty() -> AllocTag<'a>[src]

Returns a new AllocTag that points to the empty hold.

pub fn new(base: &Reified<dyn Hold<'a>>) -> AllocTag<'a>[src]

Returns a new AllocTag that points back to the Hold that allocated this tag.

pub fn init(&mut self, base: &Reified<dyn Hold<'a>>)[src]

Initializes this AllocTag to point to the Hold at base. This operation is idempotent when called repeatedly with the same base address.

pub fn from_ptr(data: *mut u8) -> *mut AllocTag<'a>[src]

Returns a pointer to the AllocTag preceding a data pointer allocated by a Hold.

pub fn holder(self: *mut AllocTag<'a>) -> &'a dyn Hold<'a>[src]

Returns a reference to the Hold that allocated this tag.

pub unsafe fn dealloc(self: *mut AllocTag<'a>, block: Block<'a>)[src]

Instructs the Hold that allocated this tag to deallocate the block.

pub unsafe fn resize(
    self: *mut AllocTag<'a>,
    block: Block<'a>,
    layout: Layout
) -> Result<Block<'a>, HoldError>
[src]

Asks the Hold that allocated this tag to attempt to resize the block.

Auto Trait Implementations

impl<'a> Send for AllocTag<'a>

impl<'a> Sync for AllocTag<'a>

Blanket Implementations

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]