-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #129785 - RalfJung:miri-sync, r=RalfJung
Miri subtree update r? `@ghost`
- Loading branch information
Showing
68 changed files
with
1,197 additions
and
441 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# This file is automatically @generated by Cargo. | ||
# It is not intended for manual editing. | ||
version = 3 | ||
|
||
[[package]] | ||
name = "slice-chunked" | ||
version = "0.1.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
[package] | ||
name = "slice-chunked" | ||
version = "0.1.0" | ||
edition = "2021" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
//! This is a small example using slice::chunks, which creates a very large Tree Borrows tree. | ||
//! Thanks to ##3837, the GC now compacts the tree, so this test can be run in a reasonable time again. | ||
//! The actual code is adapted from tiny_skia, see https://github.com/RazrFalcon/tiny-skia/blob/master/src/pixmap.rs#L121 | ||
//! To make this benchmark demonstrate the effectiveness, run with MIRIFLAGS="-Zmiri-tree-borrows -Zmiri-provenance-gc=100" | ||
|
||
const N: usize = 1000; | ||
|
||
fn input_vec() -> Vec<u8> { | ||
vec![0; N] | ||
} | ||
|
||
fn main() { | ||
let data_len = 2 * N; | ||
let mut rgba_data = Vec::with_capacity(data_len); | ||
let img_data = input_vec(); | ||
for slice in img_data.chunks(2) { | ||
let gray = slice[0]; | ||
let alpha = slice[1]; | ||
rgba_data.push(gray); | ||
rgba_data.push(gray); | ||
rgba_data.push(gray); | ||
rgba_data.push(alpha); | ||
} | ||
|
||
assert_eq!(rgba_data.len(), data_len); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
fdf61d499c8a8421ecf98e7924bb87caf43a9938 | ||
0d634185dfddefe09047881175f35c65d68dcff1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.