aboutsummaryrefslogtreecommitdiffstats
path: root/components/servo_arc
diff options
context:
space:
mode:
authorEmilio Cobos Álvarez <emilio@crisal.io>2019-07-24 13:42:45 +0200
committerEmilio Cobos Álvarez <emilio@crisal.io>2019-07-24 14:52:53 +0200
commit62907afe1c6752f3b70fe7fabc288de09afb1866 (patch)
tree50afba41c732d3841cac57277a5ae279b0bfaf33 /components/servo_arc
parent32bf5ca1bbabb1a1c695aaccbcc664bdc5fd711b (diff)
downloadservo-62907afe1c6752f3b70fe7fabc288de09afb1866.tar.gz
servo-62907afe1c6752f3b70fe7fabc288de09afb1866.zip
style: Properly refcount-log UniqueArcs created with new_uninitialized().
Diffstat (limited to 'components/servo_arc')
-rw-r--r--components/servo_arc/lib.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/components/servo_arc/lib.rs b/components/servo_arc/lib.rs
index 1567fd3d421..ad4489c10bc 100644
--- a/components/servo_arc/lib.rs
+++ b/components/servo_arc/lib.rs
@@ -125,6 +125,12 @@ impl<T> UniqueArc<T> {
.unwrap_or_else(|| alloc::handle_alloc_error(layout))
.cast::<ArcInner<mem::MaybeUninit<T>>>();
ptr::write(&mut p.as_mut().count, atomic::AtomicUsize::new(1));
+
+ #[cfg(feature = "gecko_refcount_logging")]
+ {
+ NS_LogCtor(p.as_ptr() as *mut _, b"ServoArc\0".as_ptr() as *const _, 8)
+ }
+
UniqueArc(Arc {
p,
phantom: PhantomData,