pub struct CodeMemory { /* private fields */ }
Expand description

Management of executable memory within a MmapVec

This type consumes ownership of a region of memory and will manage the executable permissions of the contained JIT code as necessary.

Implementations

Creates a new CodeMemory by taking ownership of the provided MmapVec.

The returned CodeMemory manages the internal MmapVec and the publish method is used to actually make the memory executable.

Returns a reference to the underlying MmapVec this memory owns.

Publishes the internal ELF image to be ready for execution.

This method can only be called once and will panic if called twice. This will parse the ELF image from the original MmapVec and do everything necessary to get it ready for execution, including:

  • Change page protections from read/write to read/execute.
  • Register unwinding information with the OS

After this function executes all JIT code should be ready to execute. The various parsed results of the internals of the MmapVec are returned through the Publish structure.

Trait Implementations

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.