diff options
| author | Tim Diekmann <tim.diekmann@3dvision.de> | 2020-03-24 11:45:38 +0100 |
|---|---|---|
| committer | Tim Diekmann <tim.diekmann@3dvision.de> | 2020-03-26 17:10:54 +0100 |
| commit | 56cbf2f22aeb6448acd7eb49e9b2554c80bdbf79 (patch) | |
| tree | af24a0972cda1bd07560e36c5edd5aa14b53fc7d /src/liballoc/sync.rs | |
| parent | 2fbb07525e2f07a815e780a4268b11916248b5a9 (diff) | |
| download | rust-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.rs | 6 |
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()); |
