pub struct SystemMemoryProvider { /* private fields */ }
Expand description
A memory provider that allocates memory on-demand using the system allocator.
Note: Memory will be leaked by default unless
JITMemoryProvider::free_memory
is called to ensure function pointers
remain valid for the remainder of the program’s life.
Implementations§
Trait Implementations§
Source§impl JITMemoryProvider for SystemMemoryProvider
impl JITMemoryProvider for SystemMemoryProvider
Source§unsafe fn free_memory(&mut self)
unsafe fn free_memory(&mut self)
Free the memory region.
Source§fn finalize(&mut self, branch_protection: BranchProtection) -> ModuleResult<()>
fn finalize(&mut self, branch_protection: BranchProtection) -> ModuleResult<()>
Finalize the memory region and apply memory protections.
Source§fn allocate_readexec(&mut self, size: usize, align: u64) -> Result<*mut u8>
fn allocate_readexec(&mut self, size: usize, align: u64) -> Result<*mut u8>
Allocate memory that will be executable once finalized.
Auto Trait Implementations§
impl Freeze for SystemMemoryProvider
impl RefUnwindSafe for SystemMemoryProvider
impl Send for SystemMemoryProvider
impl !Sync for SystemMemoryProvider
impl Unpin for SystemMemoryProvider
impl UnwindSafe for SystemMemoryProvider
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