Skip to content

Commit 285d806

Browse files
Azoylorentey
authored andcommitted
Take doc suggestion from Karoy swiftlang#1
Co-authored-by: Karoy Lorentey <[email protected]>
1 parent ddbd2d2 commit 285d806

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: stdlib/public/core/Unmanaged.swift

+3-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ public struct Unmanaged<Instance: AnyObject> {
3434
public static func fromOpaque(
3535
@_nonEphemeral _ value: UnsafeRawPointer
3636
) -> Unmanaged {
37-
// NOTE: This function does NOT go through the init(_private:) initializer
37+
// NOTE: `value` is allowed to be a dangling pointer, so
38+
// this function must not ever try to dereference it. For
39+
// example, it must NOT go through the init(_private:) initializer
3840
// because it requires us to materialize a strong reference to 'Instance'.
3941
// This materialization is enough to convince the compiler to add
4042
// retain/releases which we want to avoid for the opaque pointer functions.

0 commit comments

Comments
 (0)