We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 929e37d commit 93d9832Copy full SHA for 93d9832
library/core/src/alloc/mod.rs
@@ -128,7 +128,7 @@ pub unsafe trait AllocRef {
128
/// [`handle_alloc_error`]: ../../alloc/alloc/fn.handle_alloc_error.html
129
fn alloc_zeroed(&mut self, layout: Layout) -> Result<NonNull<[u8]>, AllocErr> {
130
let ptr = self.alloc(layout)?;
131
- // SAFETY: `alloc` returns a valid memory slice
+ // SAFETY: `alloc` returns a valid memory block
132
unsafe { ptr.as_non_null_ptr().as_ptr().write_bytes(0, ptr.len()) }
133
Ok(ptr)
134
}
0 commit comments