Skip to content

fix shootout-mandelbrot to make it pass the shootout test #17957

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/test/bench/shootout-mandelbrot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,15 @@ fn mandelbrot<W: io::Writer>(w: uint, mut out: W) -> io::IoResult<()> {
Future::spawn(proc () {
let mut res: Vec<u8> = Vec::with_capacity((chunk_size * w) / 8);
let init_r_slice = vec_init_r.as_slice();
for &init_i in vec_init_i.slice(i * chunk_size, (i + 1) * chunk_size).iter() {

let start = i * chunk_size;
let end = if i == (WORKERS - 1) {
start + last_chunk_size
} else {
(i + 1) * chunk_size
};

for &init_i in vec_init_i.slice(start, end).iter() {
write_line(init_i, init_r_slice, &mut res);
}

Expand Down