[][src]Struct basic_allocator::blocklist::FreeHeader

#[repr(C, align(16))]pub struct FreeHeader { /* fields omitted */ }

The header for our free blocks.

The header includes a pointer to the next free block, and the size of the current block (including the header).

We use C representation and align to 16 bytes for... simplicity. This is perhaps a stronger constraint that we need, but it does make things simple and straightforward.

Implementations

impl FreeHeader[src]

pub unsafe fn from_raw(
    ptr: NonNull<u8>,
    next: Option<FreeBlock>,
    size: usize
) -> NonNull<FreeHeader>
[src]

Construct a header from a freed memory block at ptr, with a link to the next in next, and the size of the block in size.

Safety

This is unsafe because its manipulating raw, freed memory.

To use this safely, ptr must point to memory of size size not in use by or accessible by any program logic.

Further safety constraints are enforced by the invariants of FreeBlock and BlockList.

Auto Trait Implementations

impl Send for FreeHeader

impl !Sync for FreeHeader

impl Unpin for FreeHeader

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.