@@ -2827,6 +2827,13 @@ which must be an initialized weak reference. The result is value of type
2827
2827
``$Optional<T> ``, except that it is ``null `` if the heap object has begun
2828
2828
deallocation.
2829
2829
2830
+ If ``[take] `` is specified then the underlying weak reference is invalidated
2831
+ implying that the weak reference count of the loaded value is decremented. If
2832
+ ``[take] `` is not specified then the underlying weak reference count is not
2833
+ affected by this operation (i.e. it is a +0 weak ref count operation). In either
2834
+ case, the strong reference count will be incremented before any changes to the
2835
+ weak reference count.
2836
+
2830
2837
This operation must be atomic with respect to the final ``strong_release `` on
2831
2838
the operand heap object. It need not be atomic with respect to ``store_weak ``
2832
2839
operations on the same address.
@@ -2845,7 +2852,13 @@ Initializes or reassigns a weak reference. The operand may be ``nil``.
2845
2852
2846
2853
If ``[initialization] `` is given, the weak reference must currently either be
2847
2854
uninitialized or destroyed. If it is not given, the weak reference must
2848
- currently be initialized.
2855
+ currently be initialized. After the evaluation:
2856
+
2857
+ * The value that was originally referenced by the weak reference will have
2858
+ its weak reference count decremented by 1.
2859
+ * If the optionally typed operand is non-nil, the strong reference wrapped in
2860
+ the optional has its weak reference count incremented by 1. In contrast, the reference's
2861
+ strong reference count is not touched.
2849
2862
2850
2863
This operation must be atomic with respect to the final ``strong_release `` on
2851
2864
the operand (source) heap object. It need not be atomic with respect to
0 commit comments