Skip to content

Refine the doc comments on UnsafeRawPointer.initialize.... #4560

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 31, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions stdlib/public/core/UnsafeRawPointer.swift.gyb
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,8 @@ public struct Unsafe${Mutable}RawPointer : Strideable, Hashable, _Pointer {
/// Deallocates uninitialized memory allocated for `bytes` number of bytes
/// with `alignedTo` alignment.
///
/// - Precondition: The memory is not initialized.
/// - Precondition: The memory is uninitialized or initialized to a
/// trivial type.
/// - Postcondition: The memory has been deallocated.
public func deallocate(bytes: Int, alignedTo: Int) {
Builtin.deallocRaw(
Expand All @@ -168,7 +169,8 @@ public struct Unsafe${Mutable}RawPointer : Strideable, Hashable, _Pointer {
/// Binds the allocated memory to type `T` and returns an
/// `Unsafe${Mutable}Pointer<T>` to the bound memory at `self`.
///
/// - Precondition: The memory is uninitialized.
/// - Precondition: The memory is uninitialized or initialized to a type
/// that is layout compatible with `T`.
/// - Postcondition: The memory is bound to 'T' starting at `self` continuing
/// through `self` + `count` * `MemoryLayout<T>.stride`
/// - Warning: Binding memory to a type is potentially undefined if the
Expand Down Expand Up @@ -203,7 +205,7 @@ public struct Unsafe${Mutable}RawPointer : Strideable, Hashable, _Pointer {
///
/// - Precondition: The memory at
/// `self + index * strideof(T)..<self + (index + count) * strideof(T)`
/// is uninitialized.
/// is uninitialized or initialized to a trivial type.
///
/// - Precondition: The underlying pointer is properly aligned for
/// accessing `T`.
Expand Down Expand Up @@ -243,8 +245,9 @@ public struct Unsafe${Mutable}RawPointer : Strideable, Hashable, _Pointer {
/// - Precondition: The memory regions `source..<source + count` and
/// `self..<self + count * MemoryLayout<T>.stride` do not overlap.
/// - Precondition: The memory at
/// `self..<self + count * MemoryLayout<T>.stride` is uninitialized, and
/// the `T` values at `source..<source + count` are initialized.
/// `self..<self + count * MemoryLayout<T>.stride` is uninitialized or
/// initialized to a trivial type, and the `T` values at
/// `source..<source + count` are initialized.
/// - Precondition: The underlying pointer is properly aligned for accessing
/// `T`.
/// - Postcondition: The memory at
Expand Down Expand Up @@ -281,7 +284,8 @@ public struct Unsafe${Mutable}RawPointer : Strideable, Hashable, _Pointer {
/// Returns an `UnsafeMutablePointer<T>` this memory.
///
/// - Precondition: The memory at `self..<self + source.count *
/// MemoryLayout<T>.stride` is uninitialized.
/// MemoryLayout<T>.stride` is uninitialized or initialized to a
/// trivial type.
///
/// - Postcondition: The memory at `self..<self + source.count *
/// MemoryLayout<T>.stride` is bound to type `T`.
Expand Down Expand Up @@ -310,7 +314,8 @@ public struct Unsafe${Mutable}RawPointer : Strideable, Hashable, _Pointer {
/// - Precondition: `count >= 0`
///
/// - Precondition: The memory at `self..<self + count *
/// MemoryLayout<T>.stride` is uninitialized and the `T` values at
/// MemoryLayout<T>.stride` is uninitialized or initialized to a
/// trivial type and the `T` values at
/// `source..<source + count` are initialized.
///
/// - Postcondition: The memory at `self..<self + count *
Expand Down