about summary refs log tree commit diff
diff options
context:
space:
mode:
authorCDirkx <christiaan@dirkx.email>2021-03-22 04:22:11 +0100
committerChristiaan Dirkx <christiaan@dirkx.email>2021-03-26 12:38:27 +0100
commitb01bf0e9d311332d7942619845281af4b9da54bb (patch)
tree04f3e306d8d72b7d6859c13257838c4cea9df464
parent0dbed6161a94aeb84fdae332f5b93476b6626515 (diff)
downloadrust-b01bf0e9d311332d7942619845281af4b9da54bb.tar.gz
rust-b01bf0e9d311332d7942619845281af4b9da54bb.zip
Apply suggestions from code review
Co-authored-by: David Tolnay <dtolnay@gmail.com>
-rw-r--r--library/std/src/sys/windows/alloc.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/library/std/src/sys/windows/alloc.rs b/library/std/src/sys/windows/alloc.rs
index 8ef256a06d4..3f810ffa8ca 100644
--- a/library/std/src/sys/windows/alloc.rs
+++ b/library/std/src/sys/windows/alloc.rs
@@ -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]