aboutsummaryrefslogtreecommitdiffstats
path: root/components/malloc_size_of
diff options
context:
space:
mode:
Diffstat (limited to 'components/malloc_size_of')
-rw-r--r--components/malloc_size_of/Cargo.toml3
-rw-r--r--components/malloc_size_of/lib.rs2
2 files changed, 4 insertions, 1 deletions
diff --git a/components/malloc_size_of/Cargo.toml b/components/malloc_size_of/Cargo.toml
index 8a401dd012f..cd05b5d50c0 100644
--- a/components/malloc_size_of/Cargo.toml
+++ b/components/malloc_size_of/Cargo.toml
@@ -15,6 +15,7 @@ servo = [
"mozjs",
"serde",
"serde_bytes",
+ "servo_channel",
"string_cache",
"time",
"url",
@@ -34,7 +35,7 @@ selectors = { path = "../selectors" }
serde = { version = "1.0.27", optional = true }
serde_bytes = { version = "0.10", optional = true }
servo_arc = { path = "../servo_arc" }
-servo_channel = {path = "../channel"}
+servo_channel = { path = "../channel", optional = true }
smallbitvec = "2.1.0"
smallvec = "0.6"
string_cache = { version = "0.7", optional = true }
diff --git a/components/malloc_size_of/lib.rs b/components/malloc_size_of/lib.rs
index d39d162f6b3..72b7f81595a 100644
--- a/components/malloc_size_of/lib.rs
+++ b/components/malloc_size_of/lib.rs
@@ -59,6 +59,7 @@ extern crate serde;
#[cfg(feature = "servo")]
extern crate serde_bytes;
extern crate servo_arc;
+#[cfg(feature = "servo")]
extern crate servo_channel;
extern crate smallbitvec;
extern crate smallvec;
@@ -1024,6 +1025,7 @@ where
// Placeholder for unique case where internals of Sender cannot be measured.
// malloc size of is 0 macro complains about type supplied!
+#[cfg(feature = "servo")]
impl<T> MallocSizeOf for servo_channel::Sender<T> {
fn size_of(&self, _ops: &mut MallocSizeOfOps) -> usize {
0