diff --git a/components/servo_arc/Cargo.toml b/components/servo_arc/Cargo.toml index 8eb84601b22..3581210c2f1 100644 --- a/components/servo_arc/Cargo.toml +++ b/components/servo_arc/Cargo.toml @@ -12,7 +12,7 @@ path = "lib.rs" [features] servo = ["serde"] -gecko = [] +gecko_refcount_logging = [] [dependencies] nodrop = {version = "0.1.8"} diff --git a/components/servo_arc/lib.rs b/components/servo_arc/lib.rs index 79785bbb56a..34463b52654 100644 --- a/components/servo_arc/lib.rs +++ b/components/servo_arc/lib.rs @@ -177,7 +177,7 @@ impl Arc { data, })); - #[cfg(all(feature = "gecko", debug_assertions))] + #[cfg(feature = "gecko_refcount_logging")] unsafe { // FIXME(emilio): Would be so amazing to have // std::intrinsics::type_name() around, so that we could also report @@ -312,7 +312,7 @@ impl Arc { #[inline(always)] fn record_drop(&self) { - #[cfg(all(feature = "gecko", debug_assertions))] + #[cfg(feature = "gecko_refcount_logging")] unsafe { NS_LogDtor(self.ptr() as *const _, b"ServoArc\0".as_ptr() as *const _, 8); } @@ -348,7 +348,7 @@ impl Arc { } } -#[cfg(all(feature = "gecko", debug_assertions))] +#[cfg(feature = "gecko_refcount_logging")] extern "C" { fn NS_LogCtor(aPtr: *const std::os::raw::c_void, aTypeName: *const std::os::raw::c_char, aSize: u32); fn NS_LogDtor(aPtr: *const std::os::raw::c_void, aTypeName: *const std::os::raw::c_char, aSize: u32); @@ -745,7 +745,7 @@ impl Arc> { ); } - #[cfg(all(feature = "gecko", debug_assertions))] + #[cfg(feature = "gecko_refcount_logging")] unsafe { if !is_static { // FIXME(emilio): Would be so amazing to have diff --git a/components/style/Cargo.toml b/components/style/Cargo.toml index 4d5f3e2e94d..05798b83bcb 100644 --- a/components/style/Cargo.toml +++ b/components/style/Cargo.toml @@ -22,6 +22,7 @@ servo = ["serde", "style_traits/servo", "servo_atoms", "servo_config", "html5eve "cssparser/serde", "encoding_rs", "malloc_size_of/servo", "arrayvec/use_union", "servo_url", "string_cache", "crossbeam-channel", "to_shmem/servo", "servo_arc/servo"] gecko_debug = [] +gecko_refcount_logging = [] gecko_profiler = [] [dependencies] diff --git a/components/style/rule_tree/mod.rs b/components/style/rule_tree/mod.rs index d7497a7813f..fdb306964dc 100644 --- a/components/style/rule_tree/mod.rs +++ b/components/style/rule_tree/mod.rs @@ -755,7 +755,7 @@ unsafe impl Sync for RuleTree {} unsafe impl Send for RuleTree {} // On Gecko builds, hook into the leak checking machinery. -#[cfg(all(feature = "gecko", debug_assertions))] +#[cfg(feature = "gecko_refcount_logging")] mod gecko_leak_checking { use super::RuleNode; use std::mem::size_of; @@ -788,13 +788,13 @@ mod gecko_leak_checking { #[inline(always)] fn log_new(_ptr: *const RuleNode) { - #[cfg(all(feature = "gecko", debug_assertions))] + #[cfg(feature = "gecko_refcount_logging")] gecko_leak_checking::log_ctor(_ptr); } #[inline(always)] fn log_drop(_ptr: *const RuleNode) { - #[cfg(all(feature = "gecko", debug_assertions))] + #[cfg(feature = "gecko_refcount_logging")] gecko_leak_checking::log_dtor(_ptr); }