pub struct Span { /* private fields */ }Expand description
A memory reference returned by JitAllocator::alloc
Implementations§
Source§impl Span
impl Span
Sourcepub const fn rx(&self) -> *const u8
pub const fn rx(&self) -> *const u8
Returns a pointer having Read & Execute permissions (references executable memory).
This pointer is never NULL if the allocation succeeded, it points to an executable memory.
Sourcepub const fn rw(&self) -> *mut u8
pub const fn rw(&self) -> *mut u8
Returns a pointer having Read & Write permissions (references writable memory).
Depending on the type of the allocation strategy this could either be:
- the same address as returned by
rx()if the allocator uses RWX mapping (pages have all of Read, Write, and Execute permissions) or MAP_JIT, which requires to call protect_jit_memory() manually. - a valid pointer, but not the same as
rx- this would be valid if dual mapping is used. - NULL pointer, in case that the allocation strategy doesn’t use RWX, MAP_JIT, or dual mapping. In this case only JitAllocator can copy new code into the executable memory referenced by Span.
pub const fn size(&self) -> usize
pub fn is_icache_clean(&self) -> bool
pub fn is_directly_writeable(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Span
impl RefUnwindSafe for Span
impl !Send for Span
impl !Sync for Span
impl Unpin for Span
impl UnsafeUnpin for Span
impl UnwindSafe for Span
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