Struct wasmer_compiler::CodeMemory
source · pub struct CodeMemory {
frame_info_registration: Option<GlobalFrameInfoRegistration>,
unwind_registry: UnwindRegistry,
mmap: Mmap,
start_of_nonexecutable_pages: usize,
}
Expand description
Memory manager for executable code.
Fields§
§frame_info_registration: Option<GlobalFrameInfoRegistration>
§unwind_registry: UnwindRegistry
§mmap: Mmap
§start_of_nonexecutable_pages: usize
Implementations§
source§impl CodeMemory
impl CodeMemory
sourcepub fn unwind_registry_mut(&mut self) -> &mut UnwindRegistry
pub fn unwind_registry_mut(&mut self) -> &mut UnwindRegistry
Mutably get the UnwindRegistry.
sourcepub fn allocate<'module, 'memory, FunctionBody, CustomSection>(
&'memory mut self,
functions: &'memory [&'module FunctionBody],
executable_sections: &'memory [&'module CustomSection],
data_sections: &'memory [&'module CustomSection],
) -> Result<(Vec<&'memory mut [VMFunctionBody]>, Vec<&'memory mut [u8]>, Vec<&'memory mut [u8]>), String>where
FunctionBody: FunctionBodyLike<'module> + 'module,
CustomSection: CustomSectionLike<'module> + 'module,
pub fn allocate<'module, 'memory, FunctionBody, CustomSection>(
&'memory mut self,
functions: &'memory [&'module FunctionBody],
executable_sections: &'memory [&'module CustomSection],
data_sections: &'memory [&'module CustomSection],
) -> Result<(Vec<&'memory mut [VMFunctionBody]>, Vec<&'memory mut [u8]>, Vec<&'memory mut [u8]>), String>where
FunctionBody: FunctionBodyLike<'module> + 'module,
CustomSection: CustomSectionLike<'module> + 'module,
Allocate a single contiguous block of memory at a fixed virtual address for the functions and custom sections, and copy the data in place.
sourcefn function_allocation_size<'a>(func: &'a impl FunctionBodyLike<'a>) -> usize
fn function_allocation_size<'a>(func: &'a impl FunctionBodyLike<'a>) -> usize
Calculates the allocation size of the given compiled function.
sourcefn copy_function<'module, 'memory>(
registry: &mut UnwindRegistry,
func: &'module impl FunctionBodyLike<'module>,
buf: &'memory mut [u8],
) -> &'memory mut [VMFunctionBody]
fn copy_function<'module, 'memory>( registry: &mut UnwindRegistry, func: &'module impl FunctionBodyLike<'module>, buf: &'memory mut [u8], ) -> &'memory mut [VMFunctionBody]
Copies the data of the compiled function to the given buffer.
This will also add the function to the current function table.
sourcefn view_as_mut_vmfunc_slice(slice: &mut [u8]) -> &mut [VMFunctionBody]
fn view_as_mut_vmfunc_slice(slice: &mut [u8]) -> &mut [VMFunctionBody]
Convert mut a slice from u8 to VMFunctionBody.
sourcepub fn register_frame_info(&mut self, frame_info: GlobalFrameInfoRegistration)
pub fn register_frame_info(&mut self, frame_info: GlobalFrameInfoRegistration)
Register the frame info, so it’s free when the mememory gets freed
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§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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
§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.
§impl<T> Pointee for T
impl<T> Pointee for T
source§impl<T> Upcastable for T
impl<T> Upcastable for T
source§fn upcast_any_ref(&self) -> &(dyn Any + 'static)
fn upcast_any_ref(&self) -> &(dyn Any + 'static)
upcast ref
source§fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)
upcast mut ref