We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7c1548d commit 0c59340Copy full SHA for 0c59340
library/std/src/sys/pal/windows/alloc.rs
@@ -125,6 +125,8 @@ struct Header(*mut u8);
125
unsafe fn allocate(layout: Layout, zeroed: bool) -> *mut u8 {
126
// SAFETY: Check the pointer here.
127
let heap = unsafe { get_process_heap() };
128
+ // Initializer is not called in miri, and it's OK to continue with null.
129
+ #[cfg(not(miri))]
130
if heap.is_null() {
131
// Allocation has failed, could not get the current process heap.
132
return ptr::null_mut();
0 commit comments