Skip to content

Commit 348d67b

Browse files
committed
big-allocs benchmark: use up less of the address space on 32bit
1 parent f60d909 commit 348d67b

File tree

1 file changed

+4
-1
lines changed
  • bench-cargo-miri/big-allocs/src

1 file changed

+4
-1
lines changed

bench-cargo-miri/big-allocs/src/main.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ fn main() {
77
// We can't use too big of an allocation or this code will encounter an allocation failure in
88
// CI. Since the allocation can't be huge, we need to do a few iterations so that the effect
99
// we're trying to measure is clearly visible above the interpreter's startup time.
10-
for _ in 0..10 {
10+
// FIXME (https://github.com/rust-lang/miri/issues/4253): On 32bit targets, we can run out of
11+
// usable addresses if we don't reuse, leading to random test failures.
12+
let count = if cfg!(target_pointer_width = "32") { 8 } else { 12 };
13+
for _ in 0..count {
1114
drop(Vec::<u8>::with_capacity(512 * 1024 * 1024));
1215
}
1316
}

0 commit comments

Comments
 (0)