pub struct Region { /* private fields */ }Expand description
A run of pages AllocMem mapped for this task, readable and writable, owned by this value.
Neither Clone nor Copy: there is one owner, and a mutable slice can be borrowed from it only through
&mut self, so no two live slices of it can alias.
Implementations§
Source§impl Region
impl Region
Sourcepub fn alloc(ctx: &ServiceContext, bytes: usize) -> Result<Region, AllocError>
pub fn alloc(ctx: &ServiceContext, bytes: usize) -> Result<Region, AllocError>
Ask the kernel for at least bytes of fresh memory, rounded up to whole pages.
Denied when it would pass this task’s memory limit, Failed when the machine has no frames left
or bytes is zero or too large to round.
Auto Trait Implementations§
impl Freeze for Region
impl RefUnwindSafe for Region
impl Send for Region
impl Sync for Region
impl Unpin for Region
impl UnsafeUnpin for Region
impl UnwindSafe for Region
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more