Skip to content

Commit

Permalink
fixup! Make feature gated functionaliy optional.
Browse files Browse the repository at this point in the history
  • Loading branch information
huonw committed May 24, 2015
1 parent b2fe0b3 commit e4be8df
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
3 changes: 2 additions & 1 deletion benches/expensive_float.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![cfg(feature = "unstable")]
#![feature(test)]
extern crate test;
extern crate simple_parallel;
Expand All @@ -24,7 +25,7 @@ fn pool(b: &mut test::Bencher) {
let mut pool = simple_parallel::Pool::new(4);
let f = expensive;
b.iter(|| {
pool.map(0..TOP, &f).collect::<Vec<_>>()
unsafe {pool.map(0..TOP, &f).collect::<Vec<_>>()}
})
}
#[bench]
Expand Down
9 changes: 7 additions & 2 deletions benches/transform.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![cfg(feature = "unstable")]
#![feature(test)]
extern crate test;
extern crate num_cpus;
Expand Down Expand Up @@ -28,7 +29,9 @@ fn pool_individual(b: &mut test::Bencher) {
let mut pool = simple_parallel::Pool::new(num_cpus::get());
let f = |v: &&[i32]| sum(v.iter().cloned());
run(b, |w| {
sum(pool.map(w, &f))
unsafe {
sum(pool.map(w, &f))
}
})
}

Expand All @@ -50,6 +53,8 @@ fn pool_chunked(b: &mut test::Bencher) {
run(b, |w| {
let per_chunk = (w.len() + n - 1) / n;

sum(pool.map(w.chunks(per_chunk), &f))
unsafe {
sum(pool.map(w.chunks(per_chunk), &f))
}
})
}

0 comments on commit e4be8df

Please sign in to comment.