about summary refs log tree commit diff
path: root/src/liballoc/sync.rs
diff options
context:
space:
mode:
authorTim Diekmann <tim.diekmann@3dvision.de>2020-03-24 11:45:38 +0100
committerTim Diekmann <tim.diekmann@3dvision.de>2020-03-26 17:10:54 +0100
commit56cbf2f22aeb6448acd7eb49e9b2554c80bdbf79 (patch)
treeaf24a0972cda1bd07560e36c5edd5aa14b53fc7d /src/liballoc/sync.rs
parent2fbb07525e2f07a815e780a4268b11916248b5a9 (diff)
downloadrust-56cbf2f22aeb6448acd7eb49e9b2554c80bdbf79.tar.gz
rust-56cbf2f22aeb6448acd7eb49e9b2554c80bdbf79.zip
Overhaul of the `AllocRef` trait to match allocator-wg's latest consens
Diffstat (limited to 'src/liballoc/sync.rs')
-rw-r--r--src/liballoc/sync.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/liballoc/sync.rs b/src/liballoc/sync.rs
index e8985e20256..048c89d1280 100644
--- a/src/liballoc/sync.rs
+++ b/src/liballoc/sync.rs
@@ -25,7 +25,7 @@ use core::sync::atomic;
 use core::sync::atomic::Ordering::{Acquire, Relaxed, Release, SeqCst};
 use core::{isize, usize};
 
-use crate::alloc::{box_free, handle_alloc_error, AllocRef, Global, Layout};
+use crate::alloc::{box_free, handle_alloc_error, AllocInit, AllocRef, Global, Layout};
 use crate::boxed::Box;
 use crate::rc::is_dangling;
 use crate::string::String;
@@ -814,7 +814,9 @@ impl<T: ?Sized> Arc<T> {
         // reference (see #54908).
         let layout = Layout::new::<ArcInner<()>>().extend(value_layout).unwrap().0.pad_to_align();
 
-        let (mem, _) = Global.alloc(layout).unwrap_or_else(|_| handle_alloc_error(layout));
+        let (mem, _) = Global
+            .alloc(layout, AllocInit::Uninitialized)
+            .unwrap_or_else(|_| handle_alloc_error(layout));
 
         // Initialize the ArcInner
         let inner = mem_to_arcinner(mem.as_ptr());