Skip to content

Commit

Permalink
move most of runtime/vm/cow.rs over to aligned byte counts (#9652)
Browse files Browse the repository at this point in the history
* move most of runtime/vm/cow.rs over to aligned byte counts

As part of attempting to move some of these operations over to Mmap instances,
it is nice to have type-level checking for aligned sizes. In upcoming PRs, APIs
like `map_at` will be switched to using `Mmap` instances with aligned counts.

There are a couple of spots where I have questions -- will flag them in review
comments.

* address review comments, incl workaround for #9660
  • Loading branch information
sunshowers authored Nov 22, 2024
1 parent 6bc7c44 commit 21477c7
Show file tree
Hide file tree
Showing 4 changed files with 184 additions and 103 deletions.
8 changes: 0 additions & 8 deletions crates/wasmtime/src/runtime/vm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -367,14 +367,6 @@ pub fn host_page_size() -> usize {
};
}

/// Is `bytes` a multiple of the host page size?
///
/// (Deprecated: consider switching to `HostAlignedByteCount`.)
#[cfg(feature = "signals-based-traps")]
pub fn usize_is_multiple_of_host_page_size(bytes: usize) -> bool {
bytes % host_page_size() == 0
}

/// Round the given byte size up to a multiple of the host OS page size.
///
/// Returns an error if rounding up overflows.
Expand Down
Loading

0 comments on commit 21477c7

Please sign in to comment.