We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e16bbb8 commit 6333ccfCopy full SHA for 6333ccf
std/src/sys/pal/unix/alloc.rs
@@ -13,7 +13,13 @@ unsafe impl GlobalAlloc for System {
13
if layout.align() <= MIN_ALIGN && layout.align() <= layout.size() {
14
libc::malloc(layout.size()) as *mut u8
15
} else {
16
- #[cfg(target_os = "macos")]
+ // `posix_memalign` returns a non-aligned value if supplied a very
17
+ // large alignment on older versions of Apple's platforms (unknown
18
+ // exactly which version range, but the issue is definitely
19
+ // present in macOS 10.14 and iOS 13.3).
20
+ //
21
+ // <https://github.com/rust-lang/rust/issues/30170>
22
+ #[cfg(target_vendor = "apple")]
23
{
24
if layout.align() > (1 << 31) {
25
return ptr::null_mut();
0 commit comments