Browse Source

Update to rayon 0.7

vs2017
Josh Stone 8 years ago
parent
commit
6ca7932b64
  1. 2
      Cargo.toml
  2. 5
      src/lib.rs

2
Cargo.toml

@ -18,7 +18,7 @@ travis-ci = { repository = "alexcrichton/gcc-rs" }
appveyor = { repository = "alexcrichton/gcc-rs" }
[dependencies]
rayon = { version = "0.6", optional = true }
rayon = { version = "0.7", optional = true }
[features]
parallel = ["rayon"]

5
src/lib.rs

@ -434,12 +434,13 @@ impl Config {
let mut cfg = rayon::Configuration::new();
if let Ok(amt) = env::var("NUM_JOBS") {
if let Ok(amt) = amt.parse() {
cfg = cfg.set_num_threads(amt);
cfg = cfg.num_threads(amt);
}
}
drop(rayon::initialize(cfg));
objs.par_iter().weight_max().for_each(|&(ref src, ref dst)| self.compile_object(src, dst));
objs.par_iter().with_max_len(1)
.for_each(|&(ref src, ref dst)| self.compile_object(src, dst));
}
#[cfg(not(feature = "parallel"))]

Loading…
Cancel
Save