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]
impl<T: Clone, const ALIGN: usize> Clone for GlobalAllocAsFlexSource<T, ALIGN>
[src]fn clone(&self) -> 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]
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]
impl<T: Debug, const ALIGN: usize> Debug for GlobalAllocAsFlexSource<T, ALIGN>
[src]impl<T: Default, const ALIGN: usize> Default for GlobalAllocAsFlexSource<T, ALIGN>
[src]
impl<T: Default, const ALIGN: usize> Default for GlobalAllocAsFlexSource<T, ALIGN>
[src]fn default() -> 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]
impl<T: GlobalAlloc, const ALIGN: usize> FlexSource for GlobalAllocAsFlexSource<T, ALIGN>
[src]unsafe fn alloc(&mut self, min_size: usize) -> Option<NonNull<[u8]>>
[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]
unsafe fn dealloc(&mut self, ptr: NonNull<[u8]>)
[src]Deallocate a previously allocated memory block. Read more
fn supports_dealloc(&self) -> bool
[src]
fn supports_dealloc(&self) -> bool
[src]Check if this allocator implements Self::dealloc
. Read more
fn min_align(&self) -> usize
[src]
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]
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]
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]
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]
impl<T: Init, const ALIGN: usize> Init for GlobalAllocAsFlexSource<T, ALIGN>
[src]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,
T: RefUnwindSafe,
impl<T, const ALIGN: usize> Send for GlobalAllocAsFlexSource<T, ALIGN> where
T: Send,
T: Send,
impl<T, const ALIGN: usize> Sync for GlobalAllocAsFlexSource<T, ALIGN> where
T: Sync,
T: Sync,
impl<T, const ALIGN: usize> Unpin for GlobalAllocAsFlexSource<T, ALIGN> where
T: Unpin,
T: Unpin,
impl<T, const ALIGN: usize> UnwindSafe for GlobalAllocAsFlexSource<T, ALIGN> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
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]
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