Skip to content

Commit

Permalink
Make sure we set the "maximum" parameter when creating shared memories
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael-F-Bryan committed Oct 2, 2023
1 parent 4b38f69 commit a4c286e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/wasix/src/runtime/task_manager/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,11 @@ pub trait VirtualTaskManager: std::fmt::Debug + Send + Sync + 'static {
match spawn_type {
SpawnMemoryType::CreateMemoryOfType(mut ty) => {
ty.shared = true;

// Note: If memory is shared, maximum needs to be set in the
// browser otherwise creation will fail.
let _ = ty.maximum.get_or_insert(wasmer_types::Pages::max_value());

let mem = Memory::new(&mut store, ty).map_err(|err| {
tracing::error!(
error = &err as &dyn std::error::Error,
Expand Down

0 comments on commit a4c286e

Please sign in to comment.