@@ -851,20 +851,22 @@ the memory of the annotated type:
851
851
852
852
- A value has a ** stable address** until it is either consumed or moved.
853
853
No value of any type in Swift can ever be moved while it is being borrowed or
854
- mutated, so the address of ` self ` within a ` borrowing ` or ` mutating ` method,
855
- or more generally the address of a ` borrowing ` or ` inout ` parameter to any
856
- function, cannot change within the function body. Values that appear in a
857
- global variable or class stored property can never be moved, and can only be
858
- consumed by the deallocation of the containing object instance, so
859
- effectively has a stable address for their entire lifetime.
854
+ mutated, so for a ` @_rawLayout ` type, the address of ` self ` within a
855
+ ` borrowing ` or ` mutating ` method cannot change within the function body, and
856
+ the same is true more generally for the address of any ` @_rawLayout ` typed
857
+ parameter that is ` borrowing ` or ` mutating ` in any function or method.
858
+ Values that appear in a global variable or class stored property can never be
859
+ moved, and can only be consumed by the deallocation of the containing object
860
+ instance, so effectively has a stable address for their entire lifetime.
860
861
- A value's memory ** may be read and mutated at any time** independent of
861
862
formal accesses. In particular, pointers into the storage may be "escaped"
862
- outside of scopes where the address is statically guaranteed to be stable, and
863
- those pointers may be used freely for as long as the storage dynamically
863
+ outside of scopes where the address is statically guaranteed to be stable,
864
+ and those pointers may be used freely for as long as the storage dynamically
864
865
isn't consumed or moved. It becomes the programmer's responsibility in this
865
866
case to ensure that reads and writes to the storage do not race across
866
867
threads, writes don't overlap with reads or writes coming from the same
867
- thread, and that the pointer is not used after the value is moved or consumed.
868
+ thread, and that the pointer is not used after the value is moved or
869
+ consumed.
868
870
- When the value is moved, a bitwise copy of its memory is performed to the new
869
871
address of the value in its new owner. As currently implemented, raw storage
870
872
types are not suitable for storing values which are not bitwise-movable, such
0 commit comments