[−][src]Struct basic_allocator::blocklist::FreeHeader
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]
ptr: NonNull<u8>,
next: Option<FreeBlock>,
size: usize
) -> NonNull<FreeHeader>
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
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,