Skip to content

Commit 14caaab

Browse files
Azoyglessard
andauthored
Apply suggestions from code review
Co-authored-by: Guillaume Lessard <[email protected]>
1 parent e6e8788 commit 14caaab

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

stdlib/public/core/Unmanaged.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ public struct Unmanaged<Instance: AnyObject> {
3434
public static func fromOpaque(
3535
@_nonEphemeral _ value: UnsafeRawPointer
3636
) -> Unmanaged {
37-
// NOTE: `value` is allowed to be a dangling pointer, so
37+
// NOTE: `value` is allowed to represent a dangling reference, so
3838
// this function must not ever try to dereference it. For
39-
// example, it must NOT go through the init(_private:) initializer
40-
// because it requires us to materialize a strong reference to 'Instance'.
41-
// This materialization is enough to convince the compiler to add
42-
// retain/releases which we want to avoid for the opaque pointer functions.
39+
// example, this function must NOT use the init(_private:) initializer
40+
// because doing so requires materializing a strong reference to 'Instance'.
41+
// This materialization would be enough to convince the compiler to add
42+
// retain/releases which must be avoided for the opaque pointer functions.
4343
// 'Unmanaged<Instance>' is layout compatible with 'UnsafeRawPointer' and
4444
// casting to that will not attempt to retain the reference held at 'value'.
4545
unsafeBitCast(value, to: Unmanaged<Instance>.self)

0 commit comments

Comments
 (0)