sel4_dlmalloc

Struct StaticDlmallocAllocator

Source
pub struct StaticDlmallocAllocator<T> { /* private fields */ }

Implementations§

Source§

impl<T> StaticDlmallocAllocator<T>

Source

pub const fn new(get_initial_bounds: T) -> Self

Trait Implementations§

Source§

impl<T: GetStaticHeapBounds + Send> Allocator for StaticDlmallocAllocator<T>

Source§

fn alloc(&self, size: usize) -> (*mut u8, usize, u32)

Allocates system memory region of at least size bytes Returns a triple of (base, size, flags) where base is a pointer to the beginning of the allocated memory region. size is the actual size of the region while flags specifies properties of the allocated region. If EXTERN_BIT (bit 0) set in flags, then we did not allocate this segment and so should not try to deallocate or merge with others. This function can return a std::ptr::null_mut() when allocation fails (other values of the triple will be ignored).
Source§

fn remap( &self, _ptr: *mut u8, _oldsize: usize, _newsize: usize, _can_move: bool, ) -> *mut u8

Remaps system memory region at ptr with size oldsize to a potential new location with size newsize. can_move indicates if the location is allowed to move to a completely new location, or that it is only allowed to change in size. Returns a pointer to the new location in memory. This function can return a std::ptr::null_mut() to signal an error.
Source§

fn free_part(&self, _ptr: *mut u8, _oldsize: usize, _newsize: usize) -> bool

Frees a part of a memory chunk. The original memory chunk starts at ptr with size oldsize and is turned into a memory region starting at the same address but with newsize bytes. Returns true iff the access memory region could be freed.
Source§

fn free(&self, _ptr: *mut u8, _size: usize) -> bool

Frees an entire memory region. Returns true iff the operation succeeded. When false is returned, the dlmalloc may re-use the location on future allocation requests
Source§

fn can_release_part(&self, _flags: u32) -> bool

Indicates if the system can release a part of memory. For the flags argument, see Allocator::alloc
Source§

fn allocates_zeros(&self) -> bool

Indicates whether newly allocated regions contain zeros.
Source§

fn page_size(&self) -> usize

Returns the page size. Must be a power of two

Auto Trait Implementations§

§

impl<T> !Freeze for StaticDlmallocAllocator<T>

§

impl<T> !RefUnwindSafe for StaticDlmallocAllocator<T>

§

impl<T> Send for StaticDlmallocAllocator<T>
where T: Send,

§

impl<T> !Sync for StaticDlmallocAllocator<T>

§

impl<T> Unpin for StaticDlmallocAllocator<T>
where T: Unpin,

§

impl<T> UnwindSafe for StaticDlmallocAllocator<T>
where T: UnwindSafe,

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

§

impl<T, U> TryFrom<U> for T
where 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>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

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

Performs the conversion.