[−][src]Struct alloc_compose::region::IntrusiveRegion
An intrusive region allocator, which stores the current posision in the provided memory.
It holds a lifetime to the provided memory block, which ensures, that the allocator does not outlive the underlying memory.
For a version without lifetime see RawIntrusiveRegion
instead.
Implementations
impl<'mem> IntrusiveRegion<'mem>
[src]
pub fn new(memory: &'mem mut [MaybeUninit<u8>]) -> Self
[src]
Creates a new region from the given memory block.
Panics
This function panics, when memory
is not large enough to properly store a pointer.
Trait Implementations
impl<'_> AllocRef for IntrusiveRegion<'_>
[src]
pub fn alloc(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError>
[src]
pub unsafe fn dealloc(&self, ptr: NonNull<u8>, layout: Layout)
[src]
pub unsafe fn grow(
&self,
ptr: NonNull<u8>,
old_layout: Layout,
new_layout: Layout
) -> Result<NonNull<[u8]>, AllocError>
[src]
&self,
ptr: NonNull<u8>,
old_layout: Layout,
new_layout: Layout
) -> Result<NonNull<[u8]>, AllocError>
pub unsafe fn grow_zeroed(
&self,
ptr: NonNull<u8>,
old_layout: Layout,
new_layout: Layout
) -> Result<NonNull<[u8]>, AllocError>
[src]
&self,
ptr: NonNull<u8>,
old_layout: Layout,
new_layout: Layout
) -> Result<NonNull<[u8]>, AllocError>
pub unsafe fn shrink(
&self,
ptr: NonNull<u8>,
old_layout: Layout,
new_layout: Layout
) -> Result<NonNull<[u8]>, AllocError>
[src]
&self,
ptr: NonNull<u8>,
old_layout: Layout,
new_layout: Layout
) -> Result<NonNull<[u8]>, AllocError>
pub fn alloc_zeroed(&self, layout: Layout) -> Result<NonNull<[u8]>, AllocError>
[src]
pub fn by_ref(&self) -> &Self
[src]
impl<'_> AllocateAll for IntrusiveRegion<'_>
[src]
pub fn allocate_all(&self) -> Result<NonNull<[u8]>, AllocError>
[src]
pub fn allocate_all_zeroed(&self) -> Result<NonNull<[u8]>, AllocError>
[src]
pub fn deallocate_all(&self)
[src]
pub fn capacity(&self) -> usize
[src]
pub fn capacity_left(&self) -> usize
[src]
pub fn is_empty(&self) -> bool
[src]
pub fn is_full(&self) -> bool
[src]
impl<'mem> Clone for IntrusiveRegion<'mem>
[src]
pub fn clone(&self) -> IntrusiveRegion<'mem>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<'_> GlobalAlloc for IntrusiveRegion<'_>
[src]
pub unsafe fn alloc(&self, layout: Layout) -> *mut u8
[src]
pub unsafe fn dealloc(&self, ptr: *mut u8, layout: Layout)
[src]
pub unsafe fn alloc_zeroed(&self, layout: Layout) -> *mut u8
[src]
pub unsafe fn realloc(
&self,
ptr: *mut u8,
layout: Layout,
new_size: usize
) -> *mut u8
[src]
&self,
ptr: *mut u8,
layout: Layout,
new_size: usize
) -> *mut u8
impl<'_> Owns for IntrusiveRegion<'_>
[src]
impl<'_> PartialEq<IntrusiveRegion<'_>> for IntrusiveRegion<'_>
[src]
impl<'_> PartialEq<IntrusiveRegion<'_>> for RawIntrusiveRegion
[src]
pub fn eq(&self, rhs: &IntrusiveRegion<'_>) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'_> PartialEq<RawIntrusiveRegion> for IntrusiveRegion<'_>
[src]
pub fn eq(&self, rhs: &RawIntrusiveRegion) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
Auto Trait Implementations
impl<'mem> !Send for IntrusiveRegion<'mem>
impl<'mem> !Sync for IntrusiveRegion<'mem>
impl<'mem> Unpin for IntrusiveRegion<'mem>
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,
pub 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> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
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.
pub 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>,