Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions crates/wasmtime/src/runtime/memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -738,6 +738,14 @@ impl Memory {
/// guard page. Additionally the safety concerns explained in ['Memory'], for
/// accessing the memory apply here as well.
///
/// The value returned by [`LinearMemory::byte_size`] must be at least the
/// `minimum` size the memory was created with, must be at least `new_size`
/// after a successful [`LinearMemory::grow_to`], and must never decrease.
/// At least that many bytes starting at [`LinearMemory::as_ptr`] must be
/// valid to read and write. Compiled WebAssembly code relies on these
/// properties when performing bounds checks, so violating them can lead to
/// out-of-bounds memory accesses.
///
/// Note that this is a relatively advanced feature and it is recommended to be
/// familiar with wasmtime runtime code to use it.
pub unsafe trait LinearMemory: Send + Sync + 'static {
Expand Down
Loading