Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
nia-e committed Dec 10, 2022
1 parent b609227 commit 298a793
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/bin/miri.rs
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,12 @@ fn main() {
miri_config.num_cpus = num_cpus;
} else if let Some(param) = arg.strip_prefix("-Zmiri-force-page-size=") {
let page_size = match param.parse::<u64>() {
Ok(i) => if i.is_power_of_two() { i * 1024 } else { show_error!("-Zmiri-force-page-size requires a power of 2: {}", i) },
Ok(i) =>
if i.is_power_of_two() {
i * 1024
} else {
show_error!("-Zmiri-force-page-size requires a power of 2: {}", i)
},
Err(err) => show_error!("-Zmiri-force-page-size requires a `u64`: {}", err),
};

Expand Down
6 changes: 5 additions & 1 deletion tests/pass-dep/page_size.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ fn main() {
// In particular, this checks that it is not 0.
assert!(page_size.is_power_of_two(), "page size not a power of two: {}", page_size);
// Most architectures have 4k pages by default
#[cfg(not(any(target_arch = "wasm32", target_arch = "wasm64", all(target_arch = "aarch64", target_vendor = "apple"))))]
#[cfg(not(any(
target_arch = "wasm32",
target_arch = "wasm64",
all(target_arch = "aarch64", target_vendor = "apple")
)))]
assert!(page_size == 4 * 1024, "non-4k default page size: {}", page_size);
// ... except aarch64-apple with 16k
#[cfg(all(target_arch = "aarch64", target_vendor = "apple"))]
Expand Down

0 comments on commit 298a793

Please sign in to comment.