mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
style: Properly refcount-log UniqueArcs created with new_uninitialized().
This commit is contained in:
parent
32bf5ca1bb
commit
62907afe1c
1 changed files with 6 additions and 0 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue