Skip to content

Commit 10f84f0

Browse files
authored
Merge pull request #21985 from gottesmm/pr-44903c025f4dedd6fcf95759f6512365cd8eb662
2 parents 09f1bf8 + 3585d7d commit 10f84f0

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

docs/SIL.rst

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2827,6 +2827,13 @@ which must be an initialized weak reference. The result is value of type
28272827
``$Optional<T>``, except that it is ``null`` if the heap object has begun
28282828
deallocation.
28292829

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+
28302837
This operation must be atomic with respect to the final ``strong_release`` on
28312838
the operand heap object. It need not be atomic with respect to ``store_weak``
28322839
operations on the same address.
@@ -2845,7 +2852,13 @@ Initializes or reassigns a weak reference. The operand may be ``nil``.
28452852

28462853
If ``[initialization]`` is given, the weak reference must currently either be
28472854
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.
28492862

28502863
This operation must be atomic with respect to the final ``strong_release`` on
28512864
the operand (source) heap object. It need not be atomic with respect to

0 commit comments

Comments
 (0)