Skip to content

Revert "[stdlib] AutoreleasingUnsafeMutablePointer: Switch subscripts to _read accessors" #25714

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
Jun 24, 2019
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
9 changes: 5 additions & 4 deletions stdlib/public/core/BridgeObjectiveC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -374,9 +374,10 @@ public struct AutoreleasingUnsafeMutablePointer<Pointee /* TODO : class */>
/// `Pointee`.
@inlinable
public var pointee: Pointee {
@_transparent _read {
/// Retrieve the value the pointer points to.
@_transparent get {
// We can do a strong load normally.
yield UnsafePointer(self).pointee
return UnsafePointer(self).pointee
}
/// Set the value the pointer points to, copying over the previous value.
///
Expand Down Expand Up @@ -413,9 +414,9 @@ public struct AutoreleasingUnsafeMutablePointer<Pointee /* TODO : class */>
@inlinable // unsafe-performance
public subscript(i: Int) -> Pointee {
@_transparent
_read {
get {
// We can do a strong load normally.
yield ((UnsafePointer<Pointee>(self) + i).pointee)
return (UnsafePointer<Pointee>(self) + i).pointee
}
}

Expand Down