pub struct CodeMemory { /* private fields */ }
Expand description
Memory manager for executable code.
Implementations§
Source§impl CodeMemory
impl CodeMemory
Sourcepub fn allocate_for_function(
&mut self,
func: &CompiledFunction,
) -> Result<&mut [VMFunctionBody], String>
pub fn allocate_for_function( &mut self, func: &CompiledFunction, ) -> Result<&mut [VMFunctionBody], String>
Allocate a continuous memory block for a single compiled function. TODO: Reorganize the code that calls this to emit code directly into the mmap region rather than into a Vec that we need to copy in.
Sourcepub fn allocate_for_compilation(
&mut self,
compilation: &Compilation,
) -> Result<Box<[&mut [VMFunctionBody]]>, String>
pub fn allocate_for_compilation( &mut self, compilation: &Compilation, ) -> Result<Box<[&mut [VMFunctionBody]]>, String>
Allocate a continuous memory block for a compilation.
Sourcepub fn published_contains(&self, addr: usize) -> bool
pub fn published_contains(&self, addr: usize) -> bool
Returns whether any published segment of this code memory contains
addr
.
Auto Trait Implementations§
impl Freeze for CodeMemory
impl RefUnwindSafe for CodeMemory
impl Send for CodeMemory
impl Sync for CodeMemory
impl Unpin for CodeMemory
impl UnwindSafe for CodeMemory
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more