Skip to content

Commit b01bf0e

Browse files
CDirkxdtolnay
andcommitted
Apply suggestions from code review
Co-authored-by: David Tolnay <dtolnay@gmail.com>
1 parent 0dbed61 commit b01bf0e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

library/std/src/sys/windows/alloc.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -148,13 +148,15 @@ unsafe impl GlobalAlloc for System {
148148
#[inline]
149149
unsafe fn alloc(&self, layout: Layout) -> *mut u8 {
150150
// SAFETY: pointers returned by `allocate` satisfy the guarantees of `System`
151-
unsafe { allocate(layout, false) }
151+
let zeroed = false;
152+
unsafe { allocate(layout, zeroed) }
152153
}
153154

154155
#[inline]
155156
unsafe fn alloc_zeroed(&self, layout: Layout) -> *mut u8 {
156157
// SAFETY: pointers returned by `allocate` satisfy the guarantees of `System`
157-
unsafe { allocate(layout, true) }
158+
let zeroed = true;
159+
unsafe { allocate(layout, zeroed) }
158160
}
159161

160162
#[inline]

0 commit comments

Comments
 (0)