mirror of
https://github.com/mii443/wasmer.git
synced 2025-12-12 05:18:43 +00:00
Merge branch 'master' into feat_enhanced_tinytunable_test
This commit is contained in:
29
lib/api/src/js/externals/memory_view.rs
vendored
29
lib/api/src/js/externals/memory_view.rs
vendored
@@ -58,6 +58,35 @@ impl<'a> MemoryView<'a> {
|
||||
self.size
|
||||
}
|
||||
|
||||
// TODO: do we want a proper implementation here instead?
|
||||
/// Retrieve a slice of the memory contents.
|
||||
///
|
||||
/// # Safety
|
||||
///
|
||||
/// Until the returned slice is dropped, it is undefined behaviour to
|
||||
/// modify the memory contents in any way including by calling a wasm
|
||||
/// function that writes to the memory or by resizing the memory.
|
||||
#[doc(hidden)]
|
||||
pub unsafe fn data_unchecked(&self) -> &[u8] {
|
||||
unimplemented!("direct data pointer access is not possible in JavaScript");
|
||||
}
|
||||
|
||||
// TODO: do we want a proper implementation here instead?
|
||||
/// Retrieve a mutable slice of the memory contents.
|
||||
///
|
||||
/// # Safety
|
||||
///
|
||||
/// This method provides interior mutability without an UnsafeCell. Until
|
||||
/// the returned value is dropped, it is undefined behaviour to read or
|
||||
/// write to the pointed-to memory in any way except through this slice,
|
||||
/// including by calling a wasm function that reads the memory contents or
|
||||
/// by resizing this Memory.
|
||||
#[allow(clippy::mut_from_ref)]
|
||||
#[doc(hidden)]
|
||||
pub unsafe fn data_unchecked_mut(&self) -> &mut [u8] {
|
||||
unimplemented!("direct data pointer access is not possible in JavaScript");
|
||||
}
|
||||
|
||||
/// Returns the size (in [`Pages`]) of the `Memory`.
|
||||
///
|
||||
/// # Example
|
||||
|
||||
@@ -234,7 +234,9 @@ impl Module {
|
||||
}
|
||||
|
||||
/// Serializes a module into a binary representation that the `Engine`
|
||||
/// can later process via [`Module::deserialize`].
|
||||
/// can later process via
|
||||
#[cfg_attr(feature = "compiler", doc = "[`Module::deserialize`].")]
|
||||
#[cfg_attr(not(feature = "compiler"), doc = "`Module::deserialize`.")]
|
||||
///
|
||||
/// # Usage
|
||||
///
|
||||
@@ -252,7 +254,9 @@ impl Module {
|
||||
}
|
||||
|
||||
/// Serializes a module into a file that the `Engine`
|
||||
/// can later process via [`Module::deserialize_from_file`].
|
||||
/// can later process via
|
||||
#[cfg_attr(feature = "compiler", doc = "[`Module::deserialize_from_file`].")]
|
||||
#[cfg_attr(not(feature = "compiler"), doc = "`Module::deserialize_from_file`.")]
|
||||
///
|
||||
/// # Usage
|
||||
///
|
||||
|
||||
@@ -26,7 +26,9 @@ pub(crate) struct StoreInner {
|
||||
///
|
||||
/// The `Store` holds the engine (that is —amongst many things— used to compile
|
||||
/// the Wasm bytes into a valid module artifact), in addition to the
|
||||
/// [`Tunables`] (that are used to create the memories, tables and globals).
|
||||
#[cfg_attr(feature = "compiler", doc = "[`Tunables`]")]
|
||||
#[cfg_attr(not(feature = "compiler"), doc = "`Tunables`")]
|
||||
/// (that are used to create the memories, tables and globals).
|
||||
///
|
||||
/// Spec: <https://webassembly.github.io/spec/core/exec/runtime.html#store>
|
||||
pub struct Store {
|
||||
|
||||
Reference in New Issue
Block a user