Struct rlsf::FlexTlsf [−][src]
pub struct FlexTlsf<Source: FlexSource, FLBitmap, SLBitmap, const FLLEN: usize, const SLLEN: usize> { /* fields omitted */ }
Expand description
A wrapper of Tlsf
that automatically acquires fresh memory pools from
FlexSource
.
Implementations
impl<Source: FlexSource, FLBitmap: BinInteger, SLBitmap: BinInteger, const FLLEN: usize, const SLLEN: usize> FlexTlsf<Source, FLBitmap, SLBitmap, FLLEN, SLLEN>
[src]
impl<Source: FlexSource, FLBitmap: BinInteger, SLBitmap: BinInteger, const FLLEN: usize, const SLLEN: usize> FlexTlsf<Source, FLBitmap, SLBitmap, FLLEN, SLLEN>
[src]pub fn source_ref(&self) -> &Source
[src]
pub fn source_ref(&self) -> &Source
[src]Borrow the contained Source
.
pub unsafe fn source_mut_unchecked(&mut self) -> &mut Source
[src]
pub unsafe fn source_mut_unchecked(&mut self) -> &mut Source
[src]Mutably borrow the contained Source
.
Safety
The caller must not replace the Source
with another one or modify
any existing allocations in the Source
.
pub fn allocate(&mut self, layout: Layout) -> Option<NonNull<u8>>
[src]
pub fn allocate(&mut self, layout: Layout) -> Option<NonNull<u8>>
[src]Attempt to allocate a block of memory.
Returns the starting address of the allocated memory block on success;
None
otherwise.
Time Complexity
This method will complete in constant time (assuming Source
’s methods
do so as well).
pub unsafe fn deallocate(&mut self, ptr: NonNull<u8>, align: usize)
[src]
pub unsafe fn deallocate(&mut self, ptr: NonNull<u8>, align: usize)
[src]Deallocate a previously allocated memory block.
Time Complexity
This method will complete in constant time (assuming Source
’s methods
do so as well).
Safety
ptr
must denote a memory block previously allocated viaself
.- The memory block must have been allocated with the same alignment
(
Layout::align
) asalign
.
pub unsafe fn reallocate(
&mut self,
ptr: NonNull<u8>,
new_layout: Layout
) -> Option<NonNull<u8>>
[src]
pub unsafe fn reallocate(
&mut self,
ptr: NonNull<u8>,
new_layout: Layout
) -> Option<NonNull<u8>>
[src]Shrink or grow a previously allocated memory block.
Returns the new starting address of the memory block on success;
None
otherwise.
Time Complexity
Unlike other methods, this method will complete in linear time
(O(old_size)
), assuming Source
’s methods do so as well.
Safety
ptr
must denote a memory block previously allocated viaself
.- The memory block must have been allocated with the same alignment
(
Layout::align
) asnew_layout
.
Trait Implementations
impl<Source: Debug + FlexSource, FLBitmap: Debug, SLBitmap: Debug, const FLLEN: usize, const SLLEN: usize> Debug for FlexTlsf<Source, FLBitmap, SLBitmap, FLLEN, SLLEN>
[src]
impl<Source: Debug + FlexSource, FLBitmap: Debug, SLBitmap: Debug, const FLLEN: usize, const SLLEN: usize> Debug for FlexTlsf<Source, FLBitmap, SLBitmap, FLLEN, SLLEN>
[src]impl<Source: FlexSource + Default, FLBitmap: BinInteger, SLBitmap: BinInteger, const FLLEN: usize, const SLLEN: usize> Default for FlexTlsf<Source, FLBitmap, SLBitmap, FLLEN, SLLEN>
[src]
impl<Source: FlexSource + Default, FLBitmap: BinInteger, SLBitmap: BinInteger, const FLLEN: usize, const SLLEN: usize> Default for FlexTlsf<Source, FLBitmap, SLBitmap, FLLEN, SLLEN>
[src]Initialization with a FlexSource
provided by Default::default
impl<Source: FlexSource, FLBitmap, SLBitmap, const FLLEN: usize, const SLLEN: usize> Drop for FlexTlsf<Source, FLBitmap, SLBitmap, FLLEN, SLLEN>
[src]
impl<Source: FlexSource, FLBitmap, SLBitmap, const FLLEN: usize, const SLLEN: usize> Drop for FlexTlsf<Source, FLBitmap, SLBitmap, FLLEN, SLLEN>
[src]impl<Source: FlexSource + Init, FLBitmap: BinInteger, SLBitmap: BinInteger, const FLLEN: usize, const SLLEN: usize> Init for FlexTlsf<Source, FLBitmap, SLBitmap, FLLEN, SLLEN>
[src]
impl<Source: FlexSource + Init, FLBitmap: BinInteger, SLBitmap: BinInteger, const FLLEN: usize, const SLLEN: usize> Init for FlexTlsf<Source, FLBitmap, SLBitmap, FLLEN, SLLEN>
[src]Initialization with a FlexSource
provided by Init::INIT
Auto Trait Implementations
impl<Source, FLBitmap, SLBitmap, const FLLEN: usize, const SLLEN: usize> RefUnwindSafe for FlexTlsf<Source, FLBitmap, SLBitmap, FLLEN, SLLEN> where
FLBitmap: RefUnwindSafe,
SLBitmap: RefUnwindSafe,
Source: RefUnwindSafe,
FLBitmap: RefUnwindSafe,
SLBitmap: RefUnwindSafe,
Source: RefUnwindSafe,
impl<Source, FLBitmap, SLBitmap, const FLLEN: usize, const SLLEN: usize> Send for FlexTlsf<Source, FLBitmap, SLBitmap, FLLEN, SLLEN> where
Source: Send,
Source: Send,
impl<Source, FLBitmap, SLBitmap, const FLLEN: usize, const SLLEN: usize> Sync for FlexTlsf<Source, FLBitmap, SLBitmap, FLLEN, SLLEN> where
Source: Sync,
Source: Sync,
impl<Source, FLBitmap, SLBitmap, const FLLEN: usize, const SLLEN: usize> Unpin for FlexTlsf<Source, FLBitmap, SLBitmap, FLLEN, SLLEN> where
FLBitmap: Unpin,
SLBitmap: Unpin,
Source: Unpin,
FLBitmap: Unpin,
SLBitmap: Unpin,
Source: Unpin,