aboutsummaryrefslogtreecommitdiffstats
path: root/components/style
diff options
context:
space:
mode:
authorNathan Froyd <froydnj@gmail.com>2017-02-22 11:22:16 -0500
committerNathan Froyd <froydnj@gmail.com>2017-02-22 11:35:08 -0500
commitfafcdda16ab8f39c15e8b3b6fb20526540d47d24 (patch)
tree1ee75eec7419dced2445304d68a7012b4493e630 /components/style
parent3e81f8431e4e47c3c042cb4527582d6b5cdaf0ac (diff)
downloadservo-fafcdda16ab8f39c15e8b3b6fb20526540d47d24.tar.gz
servo-fafcdda16ab8f39c15e8b3b6fb20526540d47d24.zip
geckolib: move NUM_THREADS from style to geckolib
This change eliminates some gecko-only configuration in the style component and moves NUM_THREADS closer to its only uses.
Diffstat (limited to 'components/style')
-rw-r--r--components/style/Cargo.toml6
-rw-r--r--components/style/gecko/data.rs13
-rw-r--r--components/style/lib.rs1
3 files changed, 1 insertions, 19 deletions
diff --git a/components/style/Cargo.toml b/components/style/Cargo.toml
index 563c7ed0967..7576ec4b7ea 100644
--- a/components/style/Cargo.toml
+++ b/components/style/Cargo.toml
@@ -13,7 +13,7 @@ path = "lib.rs"
doctest = false
[features]
-gecko = ["nsstring_vendor", "num_cpus", "rayon/unstable"]
+gecko = ["nsstring_vendor", "rayon/unstable"]
use_bindgen = ["bindgen", "regex"]
servo = ["serde/unstable", "serde", "serde_derive", "heapsize_derive",
"style_traits/servo", "servo_atoms", "html5ever-atoms",
@@ -57,10 +57,6 @@ servo_url = {path = "../url"}
time = "0.1"
unicode-segmentation = "1.0"
-[dependencies.num_cpus]
-optional = true
-version = "1.0"
-
[target.'cfg(windows)'.dependencies]
kernel32-sys = "0.2"
diff --git a/components/style/gecko/data.rs b/components/style/gecko/data.rs
index 916680dad39..89c18fa6a06 100644
--- a/components/style/gecko/data.rs
+++ b/components/style/gecko/data.rs
@@ -11,12 +11,9 @@ use gecko_bindings::bindings::RawServoStyleSet;
use gecko_bindings::structs::RawGeckoPresContextOwned;
use gecko_bindings::sugar::ownership::{HasBoxFFI, HasFFI, HasSimpleFFI};
use media_queries::Device;
-use num_cpus;
use parking_lot::RwLock;
use properties::ComputedValues;
-use std::cmp;
use std::collections::HashMap;
-use std::env;
use std::sync::Arc;
use std::sync::mpsc::{Receiver, Sender, channel};
use stylesheets::Stylesheet;
@@ -53,16 +50,6 @@ pub struct PerDocumentStyleDataImpl {
/// and unexpected races while trying to mutate it.
pub struct PerDocumentStyleData(AtomicRefCell<PerDocumentStyleDataImpl>);
-lazy_static! {
- /// The number of layout threads, computed statically.
- pub static ref NUM_THREADS: usize = {
- match env::var("STYLO_THREADS").map(|s| s.parse::<usize>().expect("invalid STYLO_THREADS")) {
- Ok(num) => num,
- _ => cmp::max(num_cpus::get() * 3 / 4, 1),
- }
- };
-}
-
impl PerDocumentStyleData {
/// Create a dummy `PerDocumentStyleData`.
pub fn new(pres_context: RawGeckoPresContextOwned) -> Self {
diff --git a/components/style/lib.rs b/components/style/lib.rs
index 6954c0fe3e7..d94f5436b51 100644
--- a/components/style/lib.rs
+++ b/components/style/lib.rs
@@ -61,7 +61,6 @@ extern crate matches;
#[cfg(feature = "gecko")] extern crate nsstring_vendor as nsstring;
extern crate num_integer;
extern crate num_traits;
-#[cfg(feature = "gecko")] extern crate num_cpus;
extern crate ordered_float;
extern crate owning_ref;
extern crate parking_lot;