about summary refs log tree commit diff
path: root/library/alloc/src
diff options
context:
space:
mode:
authorAljoscha Meyer <AljoschaMeyer@users.noreply.github.com>2024-07-22 08:17:46 +0200
committerGitHub <noreply@github.com>2024-07-22 08:17:46 +0200
commit351fe273547ac57ddf829b358dff538ab587599a (patch)
tree8ed92df9829e697306eaf98187e7a47d458040aa /library/alloc/src
parent497ef498053be7e6ef9e8af1bf7dc1e8800674c1 (diff)
downloadrust-351fe273547ac57ddf829b358dff538ab587599a.tar.gz
rust-351fe273547ac57ddf829b358dff538ab587599a.zip
Use given allocator instad of Global
Diffstat (limited to 'library/alloc/src')
-rw-r--r--library/alloc/src/boxed.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/library/alloc/src/boxed.rs b/library/alloc/src/boxed.rs
index 322c0756abd..5117f883af2 100644
--- a/library/alloc/src/boxed.rs
+++ b/library/alloc/src/boxed.rs
@@ -867,7 +867,7 @@ impl<T, A: Allocator> 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<T, A: Allocator> 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)) }
     }