@@ -158,7 +158,8 @@ public struct Unsafe${Mutable}RawPointer : Strideable, Hashable, _Pointer {
158
158
/// Deallocates uninitialized memory allocated for `bytes` number of bytes
159
159
/// with `alignedTo` alignment.
160
160
///
161
- /// - Precondition: The memory is not initialized.
161
+ /// - Precondition: The memory is uninitialized or initialized to a
162
+ /// trivial type.
162
163
/// - Postcondition: The memory has been deallocated.
163
164
public func deallocate( bytes: Int , alignedTo: Int ) {
164
165
Builtin . deallocRaw (
@@ -168,7 +169,8 @@ public struct Unsafe${Mutable}RawPointer : Strideable, Hashable, _Pointer {
168
169
/// Binds the allocated memory to type `T` and returns an
169
170
/// `Unsafe${Mutable}Pointer<T>` to the bound memory at `self`.
170
171
///
171
- /// - Precondition: The memory is uninitialized.
172
+ /// - Precondition: The memory is uninitialized or initialized to a type
173
+ /// that is layout compatible with `T`.
172
174
/// - Postcondition: The memory is bound to 'T' starting at `self` continuing
173
175
/// through `self` + `count` * `MemoryLayout<T>.stride`
174
176
/// - Warning: Binding memory to a type is potentially undefined if the
@@ -203,7 +205,7 @@ public struct Unsafe${Mutable}RawPointer : Strideable, Hashable, _Pointer {
203
205
///
204
206
/// - Precondition: The memory at
205
207
/// `self + index * strideof(T)..<self + (index + count) * strideof(T)`
206
- /// is uninitialized.
208
+ /// is uninitialized or initialized to a trivial type .
207
209
///
208
210
/// - Precondition: The underlying pointer is properly aligned for
209
211
/// accessing `T`.
@@ -243,8 +245,9 @@ public struct Unsafe${Mutable}RawPointer : Strideable, Hashable, _Pointer {
243
245
/// - Precondition: The memory regions `source..<source + count` and
244
246
/// `self..<self + count * MemoryLayout<T>.stride` do not overlap.
245
247
/// - Precondition: The memory at
246
- /// `self..<self + count * MemoryLayout<T>.stride` is uninitialized, and
247
- /// the `T` values at `source..<source + count` are initialized.
248
+ /// `self..<self + count * MemoryLayout<T>.stride` is uninitialized or
249
+ /// initialized to a trivial type, and the `T` values at
250
+ /// `source..<source + count` are initialized.
248
251
/// - Precondition: The underlying pointer is properly aligned for accessing
249
252
/// `T`.
250
253
/// - Postcondition: The memory at
@@ -281,7 +284,8 @@ public struct Unsafe${Mutable}RawPointer : Strideable, Hashable, _Pointer {
281
284
/// Returns an `UnsafeMutablePointer<T>` this memory.
282
285
///
283
286
/// - Precondition: The memory at `self..<self + source.count *
284
- /// MemoryLayout<T>.stride` is uninitialized.
287
+ /// MemoryLayout<T>.stride` is uninitialized or initialized to a
288
+ /// trivial type.
285
289
///
286
290
/// - Postcondition: The memory at `self..<self + source.count *
287
291
/// MemoryLayout<T>.stride` is bound to type `T`.
@@ -310,7 +314,8 @@ public struct Unsafe${Mutable}RawPointer : Strideable, Hashable, _Pointer {
310
314
/// - Precondition: `count >= 0`
311
315
///
312
316
/// - Precondition: The memory at `self..<self + count *
313
- /// MemoryLayout<T>.stride` is uninitialized and the `T` values at
317
+ /// MemoryLayout<T>.stride` is uninitialized or initialized to a
318
+ /// trivial type and the `T` values at
314
319
/// `source..<source + count` are initialized.
315
320
///
316
321
/// - Postcondition: The memory at `self..<self + count *
0 commit comments