JITMemoryProvider

Trait JITMemoryProvider 

Source
pub trait JITMemoryProvider {
    // Required methods
    fn allocate_readexec(&mut self, size: usize, align: u64) -> Result<*mut u8>;
    fn allocate_readwrite(&mut self, size: usize, align: u64) -> Result<*mut u8>;
    fn allocate_readonly(&mut self, size: usize, align: u64) -> Result<*mut u8>;
    unsafe fn free_memory(&mut self);
    fn finalize(
        &mut self,
        branch_protection: BranchProtection,
    ) -> ModuleResult<()>;
}
Expand description

A provider of memory for the JIT.

Required Methods§

Source

fn allocate_readexec(&mut self, size: usize, align: u64) -> Result<*mut u8>

Allocate memory that will be executable once finalized.

Source

fn allocate_readwrite(&mut self, size: usize, align: u64) -> Result<*mut u8>

Allocate writable memory.

Source

fn allocate_readonly(&mut self, size: usize, align: u64) -> Result<*mut u8>

Allocate memory that will be read-only once finalized.

Source

unsafe fn free_memory(&mut self)

Free the memory region.

Source

fn finalize(&mut self, branch_protection: BranchProtection) -> ModuleResult<()>

Finalize the memory region and apply memory protections.

Implementors§