Struct rlsf::GlobalAllocAsFlexSource[][src]

pub struct GlobalAllocAsFlexSource<T, const ALIGN: usize>(pub T);
Expand description

Wraps core::alloc::GlobalAlloc to implement the FlexSource trait.

Since this type does not implement FlexSource::realloc_inplace_grow, it is likely to end up with terribly fragmented memory pools.

Trait Implementations

impl<T: Clone, const ALIGN: usize> Clone for GlobalAllocAsFlexSource<T, ALIGN>[src]

fn clone(&self) -> GlobalAllocAsFlexSource<T, ALIGN>[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<T: Debug, const ALIGN: usize> Debug for GlobalAllocAsFlexSource<T, ALIGN>[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl<T: Default, const ALIGN: usize> Default for GlobalAllocAsFlexSource<T, ALIGN>[src]

fn default() -> GlobalAllocAsFlexSource<T, ALIGN>[src]

Returns the “default value” for a type. Read more

impl<T: GlobalAlloc, const ALIGN: usize> FlexSource for GlobalAllocAsFlexSource<T, ALIGN>[src]

unsafe fn alloc(&mut self, min_size: usize) -> Option<NonNull<[u8]>>[src]

Allocate a memory block of the requested minimum size. Read more

unsafe fn dealloc(&mut self, ptr: NonNull<[u8]>)[src]

Deallocate a previously allocated memory block. Read more

fn supports_dealloc(&self) -> bool[src]

Check if this allocator implements Self::dealloc. Read more

fn min_align(&self) -> usize[src]

Get the minimum alignment of allocations made by this allocator. FlexTlsf may be less efficient if this method returns a value less than GRANULARITY. Read more

unsafe fn realloc_inplace_grow(
    &mut self,
    ptr: NonNull<[u8]>,
    min_new_len: usize
) -> Option<usize>
[src]

Attempt to grow the specified allocation without moving it. Returns the final allocation size (which must be greater than or equal to min_new_len) on success. Read more

fn supports_realloc_inplace_grow(&self) -> bool[src]

Check if this allocator implements Self::realloc_inplace_grow. Read more

fn is_contiguous_growable(&self) -> bool[src]

Returns true if this allocator is implemented by managing one contiguous region, which is grown every time alloc or realloc_inplace_grow is called. Read more

impl<T: Init, const ALIGN: usize> Init for GlobalAllocAsFlexSource<T, ALIGN>[src]

const INIT: Self[src]

Self’s default value.

impl<T: Copy, const ALIGN: usize> Copy for GlobalAllocAsFlexSource<T, ALIGN>[src]

Auto Trait Implementations

impl<T, const ALIGN: usize> RefUnwindSafe for GlobalAllocAsFlexSource<T, ALIGN> where
    T: RefUnwindSafe

impl<T, const ALIGN: usize> Send for GlobalAllocAsFlexSource<T, ALIGN> where
    T: Send

impl<T, const ALIGN: usize> Sync for GlobalAllocAsFlexSource<T, ALIGN> where
    T: Sync

impl<T, const ALIGN: usize> Unpin for GlobalAllocAsFlexSource<T, ALIGN> where
    T: Unpin

impl<T, const ALIGN: usize> UnwindSafe for GlobalAllocAsFlexSource<T, ALIGN> where
    T: UnwindSafe

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

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.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.