From d6a36f520f5903ec5abbedf81f769593a7020b74 Mon Sep 17 00:00:00 2001 From: Aljoscha Meyer Date: Mon, 22 Jul 2024 08:17:46 +0200 Subject: [PATCH] Use given allocator instad of Global --- alloc/src/boxed.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/alloc/src/boxed.rs b/alloc/src/boxed.rs index 322c0756abdb3..5117f883af2b6 100644 --- a/alloc/src/boxed.rs +++ b/alloc/src/boxed.rs @@ -867,7 +867,7 @@ impl Box<[T], A> { Ok(l) => l, Err(_) => return Err(AllocError), }; - Global.allocate(layout)?.cast() + alloc.allocate(layout)?.cast() }; unsafe { Ok(RawVec::from_raw_parts_in(ptr.as_ptr(), len, alloc).into_box(len)) } } @@ -906,7 +906,7 @@ impl Box<[T], A> { Ok(l) => l, Err(_) => return Err(AllocError), }; - Global.allocate_zeroed(layout)?.cast() + alloc.allocate_zeroed(layout)?.cast() }; unsafe { Ok(RawVec::from_raw_parts_in(ptr.as_ptr(), len, alloc).into_box(len)) } }