diff --git a/Cargo.lock b/Cargo.lock index 34643bd0e8b..818493ea05f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1693,6 +1693,7 @@ dependencies = [ "euclid 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)", "hashglobe 0.1.0", "mozjs 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "selectors 0.19.0", "servo_arc 0.0.1", "smallbitvec 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2717,8 +2718,6 @@ dependencies = [ "cssparser 0.23.2 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", - "malloc_size_of 0.0.1", - "malloc_size_of_derive 0.0.1", "matches 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "phf 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)", "phf_codegen 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)", diff --git a/components/malloc_size_of/Cargo.toml b/components/malloc_size_of/Cargo.toml index a5c3acfb861..9b24d6dade8 100644 --- a/components/malloc_size_of/Cargo.toml +++ b/components/malloc_size_of/Cargo.toml @@ -17,6 +17,7 @@ cssparser = "0.23.0" euclid = "0.16" hashglobe = { path = "../hashglobe" } mozjs = { version = "0.1.8", features = ["promises"], optional = true } +selectors = { path = "../selectors" } servo_arc = { path = "../servo_arc" } smallbitvec = "1.0.3" smallvec = "0.6" diff --git a/components/malloc_size_of/lib.rs b/components/malloc_size_of/lib.rs index b366de512f0..2ec16f380de 100644 --- a/components/malloc_size_of/lib.rs +++ b/components/malloc_size_of/lib.rs @@ -49,6 +49,7 @@ extern crate euclid; extern crate hashglobe; #[cfg(feature = "servo")] extern crate mozjs as js; +extern crate selectors; extern crate servo_arc; extern crate smallbitvec; extern crate smallvec; @@ -640,6 +641,13 @@ impl MallocSizeOf for euclid::TypedVector2D { } } +impl MallocSizeOf for selectors::parser::AncestorHashes { + fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize { + let selectors::parser::AncestorHashes { ref packed_hashes } = *self; + packed_hashes.size_of(ops) + } +} + #[cfg(feature = "servo")] impl MallocSizeOf for string_cache::Atom { fn size_of(&self, _ops: &mut MallocSizeOfOps) -> usize { diff --git a/components/selectors/Cargo.toml b/components/selectors/Cargo.toml index 86466213adc..0dfca53e32f 100644 --- a/components/selectors/Cargo.toml +++ b/components/selectors/Cargo.toml @@ -26,8 +26,6 @@ matches = "0.1" cssparser = "0.23.0" log = "0.3" fnv = "1.0" -malloc_size_of = { path = "../malloc_size_of" } -malloc_size_of_derive = { path = "../malloc_size_of_derive" } phf = "0.7.18" precomputed-hash = "0.1" servo_arc = { path = "../servo_arc" } diff --git a/components/selectors/lib.rs b/components/selectors/lib.rs index c8e7ce175d5..a0f929ecfbb 100644 --- a/components/selectors/lib.rs +++ b/components/selectors/lib.rs @@ -10,8 +10,6 @@ #[macro_use] extern crate log; #[macro_use] extern crate matches; extern crate fnv; -extern crate malloc_size_of; -#[macro_use] extern crate malloc_size_of_derive; extern crate phf; extern crate precomputed_hash; #[cfg(test)] #[macro_use] extern crate size_of_test; diff --git a/components/selectors/parser.rs b/components/selectors/parser.rs index 99b73353abf..e39ba36bd4e 100644 --- a/components/selectors/parser.rs +++ b/components/selectors/parser.rs @@ -266,7 +266,7 @@ where /// off the upper bits) at the expense of making the fourth somewhat more /// complicated to assemble, because we often bail out before checking all the /// hashes. -#[derive(Clone, Debug, Eq, MallocSizeOf, PartialEq)] +#[derive(Clone, Debug, Eq, PartialEq)] pub struct AncestorHashes { pub packed_hashes: [u32; 3], }