Skip to content

Commit

Permalink
Add missing rounding up to host page size at runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
fitzgen committed Jun 11, 2024
1 parent b44ec14 commit e1a076b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions crates/wasmtime/src/runtime/vm/memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ impl MmapMemory {
MemoryStyle::Static { byte_reservation } => {
assert!(byte_reservation >= plan.memory.minimum_byte_size().unwrap());
let bound_bytes = usize::try_from(byte_reservation).unwrap();
let bound_bytes = round_usize_up_to_host_pages(bound_bytes)?;
maximum = Some(bound_bytes.min(maximum.unwrap_or(usize::MAX)));
(bound_bytes, 0)
}
Expand Down

0 comments on commit e1a076b

Please sign in to comment.