Struct solana_rbpf::memory_region::MemoryRegion
source · [−]#[repr(C, align(32))]pub struct MemoryRegion {
pub host_addr: u64,
pub vm_addr: u64,
pub len: u64,
pub vm_gap_shift: u8,
pub is_writable: bool,
}
Expand description
Memory region for bounds checking and address translation
Fields
host_addr: u64
start host address
vm_addr: u64
start virtual address
len: u64
Length in bytes
vm_gap_shift: u8
Size of regular gaps as bit shift (63 means this region is continuous)
is_writable: bool
Is also writable (otherwise it is readonly)
Implementations
Creates a new MemoryRegion structure from a slice
pub fn vm_to_host<E: UserDefinedError>(
&self,
vm_addr: u64,
len: u64
) -> Result<u64, EbpfError<E>>
pub fn vm_to_host<E: UserDefinedError>(
&self,
vm_addr: u64,
len: u64
) -> Result<u64, EbpfError<E>>
Convert a virtual machine address into a host address Does not perform a lower bounds check, as that is already done by the binary search in MemoryMapping::map()
Trait Implementations
Returns the “default value” for a type. Read more
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Auto Trait Implementations
impl RefUnwindSafe for MemoryRegion
impl Send for MemoryRegion
impl Sync for MemoryRegion
impl Unpin for MemoryRegion
impl UnwindSafe for MemoryRegion
Blanket Implementations
Mutably borrows from an owned value. Read more