From 5ded13c8dd29a936f2bb4e6188b7c1e8d5c42173 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Tue, 1 Nov 2016 23:36:11 -0600 Subject: [PATCH] stdlib: Make Unsafe{Mutable,}BufferPointer @_fixed_layout to work around rdar://18157434 --- stdlib/public/core/UnsafeBufferPointer.swift.gyb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/stdlib/public/core/UnsafeBufferPointer.swift.gyb b/stdlib/public/core/UnsafeBufferPointer.swift.gyb index 8cab8155833a3..2719e0b0fae19 100644 --- a/stdlib/public/core/UnsafeBufferPointer.swift.gyb +++ b/stdlib/public/core/UnsafeBufferPointer.swift.gyb @@ -36,6 +36,11 @@ public struct UnsafeBufferPointerIterator /// underlying elements. /// /// The pointer should be aligned to `MemoryLayout.alignment`. + +// FIXME: rdar://18157434 - until this is fixed, this has to be fixed layout +// to avoid a hang in Foundation, which has the following setup: +// struct A { struct B { let x: UnsafeMutableBufferPointer<...> } let b: B } +@_fixed_layout public struct Unsafe${Mutable}BufferPointer : _${Mutable}Indexable, ${Mutable}Collection, RandomAccessCollection {