[−][src]Struct wasmer_runtime_core::memory::DynamicMemory
This is an internal-only api.
A Dynamic memory allocates only the minimum amount of memory when first created. Over time, as it grows, it may reallocate to a different location and size.
Dynamic memories are significantly faster to create than static memories and use much less virtual memory, however, they require the WebAssembly module to bounds-check memory accesses.
While, a dynamic memory could use a vector of some sort as its backing memory, we use mmap (or the platform-equivalent) to allow us to add a guard-page at the end to help elide some bounds-checks.
Methods
impl DynamicMemory
[src]
pub fn size(&self) -> Pages
[src]
The size of this memory in Pages
.
pub fn grow(
&mut self,
delta: Pages,
local: &mut LocalMemory
) -> Result<Pages, GrowError>
[src]
&mut self,
delta: Pages,
local: &mut LocalMemory
) -> Result<Pages, GrowError>
Try to grow self by the given number of delta pages.
pub fn as_slice(&self) -> &[u8]
[src]
Get this memory represented as a slice of bytes.
pub fn as_slice_mut(&mut self) -> &mut [u8]
[src]
Get this memory represented as a mutable slice of bytes
Auto Trait Implementations
impl RefUnwindSafe for DynamicMemory
impl Send for DynamicMemory
impl Sync for DynamicMemory
impl Unpin for DynamicMemory
impl UnwindSafe for DynamicMemory
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
[src]
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,