mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-28 02:57:37 +00:00
Apply suggestions from code review
Co-authored-by: David Tolnay <dtolnay@gmail.com>
This commit is contained in:
parent
0dbed6161a
commit
b01bf0e9d3
@ -148,13 +148,15 @@ unsafe impl GlobalAlloc for System {
|
||||
#[inline]
|
||||
unsafe fn alloc(&self, layout: Layout) -> *mut u8 {
|
||||
// SAFETY: pointers returned by `allocate` satisfy the guarantees of `System`
|
||||
unsafe { allocate(layout, false) }
|
||||
let zeroed = false;
|
||||
unsafe { allocate(layout, zeroed) }
|
||||
}
|
||||
|
||||
#[inline]
|
||||
unsafe fn alloc_zeroed(&self, layout: Layout) -> *mut u8 {
|
||||
// SAFETY: pointers returned by `allocate` satisfy the guarantees of `System`
|
||||
unsafe { allocate(layout, true) }
|
||||
let zeroed = true;
|
||||
unsafe { allocate(layout, zeroed) }
|
||||
}
|
||||
|
||||
#[inline]
|
||||
|
Loading…
Reference in New Issue
Block a user