Skip to content

[SE-0334] Fix typos #1772

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
Sep 5, 2022
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
4 changes: 2 additions & 2 deletions proposals/0334-pointer-usability-improvements.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,12 @@ Calculating the offset between the start of the data structure to the field of t
We propose to add a function to help perform this operation on raw pointer types:
```swift
extension UnsafeRawPointer {
public func alignedUp<T>(for: T.type) -> Self
public func alignedUp<T>(for: T.Type) -> Self
}
```

This function will round the current pointer up to the next address properly aligned to access an instance of `T`.
When applied to a `self` already aligned for `T`, `UnsafeRawPointer.aligned(for:)` will return `self`.
When applied to a `self` already aligned for `T`, `UnsafeRawPointer.alignedUp(for:)` will return `self`.

The new function would make identifying the storage location of `T` much more straightforward than in the example above:
```swift
Expand Down