forked from bytecodealliance/wasmtime
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use
signals-based-traps
to gate virtual memory too
This commit updates the `signals-based-traps` Cargo feature to additionally gate the use of virtual memory in Wasmtime. When this feature is disabled it now additionally disables the reliance on virtual memory as an implementation detail of WebAssembly linear memories. Additionally `CodeMemory` no longer can rely on virtual memory meaning that code cannot be made executable. The main purpose of this commit is to provide a build mode of Wasmtime that does not rely on virtual memory at all. This is currently only suitable for Pulley where there is no new native code but it should be an easier starting point for other small adjustments in the future if necessary. prtest:full
- Loading branch information
1 parent
1b2d866
commit aab4dcd
Showing
13 changed files
with
250 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
//! Small shims for CoW support when virtual memory is disabled, meaning that | ||
//! none of the types in this module are supported. | ||
#![warn(dead_code, unused_imports)] | ||
|
||
use crate::prelude::*; | ||
use crate::runtime::vm::MmapVec; | ||
use alloc::sync::Arc; | ||
use wasmtime_environ::{DefinedMemoryIndex, Module}; | ||
|
||
pub enum ModuleMemoryImages {} | ||
|
||
impl ModuleMemoryImages { | ||
pub fn get_memory_image( | ||
&self, | ||
_defined_index: DefinedMemoryIndex, | ||
) -> Option<&Arc<MemoryImage>> { | ||
None | ||
} | ||
} | ||
|
||
#[derive(Debug, PartialEq)] | ||
pub enum MemoryImage {} | ||
|
||
impl ModuleMemoryImages { | ||
pub fn new( | ||
_module: &Module, | ||
_wasm_data: &[u8], | ||
_mmap: Option<&MmapVec>, | ||
) -> Result<Option<ModuleMemoryImages>> { | ||
Ok(None) | ||
} | ||
} | ||
|
||
#[derive(Debug)] | ||
pub enum MemoryImageSlot {} | ||
|
||
impl MemoryImageSlot { | ||
pub(crate) fn set_heap_limit(&mut self, _size_bytes: usize) -> Result<()> { | ||
match *self {} | ||
} | ||
|
||
pub(crate) fn has_image(&self) -> bool { | ||
match *self {} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.