We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ddbd2d2 commit 285d806Copy full SHA for 285d806
stdlib/public/core/Unmanaged.swift
@@ -34,7 +34,9 @@ public struct Unmanaged<Instance: AnyObject> {
34
public static func fromOpaque(
35
@_nonEphemeral _ value: UnsafeRawPointer
36
) -> Unmanaged {
37
- // NOTE: This function does NOT go through the init(_private:) initializer
+ // 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
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.
0 commit comments