File tree Expand file tree Collapse file tree 3 files changed +28
-0
lines changed
src/tools/miri/bench-cargo-miri/big-allocs Expand file tree Collapse file tree 3 files changed +28
-0
lines changed Original file line number Diff line number Diff line change 1+ # This file is automatically @generated by Cargo.
2+ # It is not intended for manual editing.
3+ version = 3
4+
5+ [[package ]]
6+ name = " big-allocs"
7+ version = " 0.1.0"
Original file line number Diff line number Diff line change 1+ [package ]
2+ name = " big-allocs"
3+ version = " 0.1.0"
4+ edition = " 2021"
5+
6+ # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
7+
8+ [dependencies ]
Original file line number Diff line number Diff line change 1+ //! This is a regression test for https://github.com/rust-lang/miri/issues/3637.
2+ //! `Allocation`s are backed by a `Box<[u8]>`, which we create using `alloc_zeroed`, which should
3+ //! make very large allocations cheap. But then we also need to not clone those `Allocation`s, or
4+ //! we end up slow anyway.
5+
6+ fn main ( ) {
7+ // We can't use too big of an allocation or this code will encounter an allocation failure in
8+ // CI. Since the allocation can't be huge, we need to do a few iterations so that the effect
9+ // we're trying to measure is clearly visible above the interpreter's startup time.
10+ for _ in 0 ..10 {
11+ drop ( Vec :: < u8 > :: with_capacity ( 512 * 1024 * 1024 ) ) ;
12+ }
13+ }
You can’t perform that action at this time.
0 commit comments