Skip to content

Commit d6a36f5

Browse files
Use given allocator instad of Global
1 parent ca537d2 commit d6a36f5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: alloc/src/boxed.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -867,7 +867,7 @@ impl<T, A: Allocator> Box<[T], A> {
867867
Ok(l) => l,
868868
Err(_) => return Err(AllocError),
869869
};
870-
Global.allocate(layout)?.cast()
870+
alloc.allocate(layout)?.cast()
871871
};
872872
unsafe { Ok(RawVec::from_raw_parts_in(ptr.as_ptr(), len, alloc).into_box(len)) }
873873
}
@@ -906,7 +906,7 @@ impl<T, A: Allocator> Box<[T], A> {
906906
Ok(l) => l,
907907
Err(_) => return Err(AllocError),
908908
};
909-
Global.allocate_zeroed(layout)?.cast()
909+
alloc.allocate_zeroed(layout)?.cast()
910910
};
911911
unsafe { Ok(RawVec::from_raw_parts_in(ptr.as_ptr(), len, alloc).into_box(len)) }
912912
}

0 commit comments

Comments
 (0)