@@ -718,18 +718,23 @@ generic constraints:
718
718
* @weak types
719
719
* Types that can't satisfy the requirements for being loadable because they
720
720
care about the exact location of their value in memory and need to run some
721
- user-written code when they are copied or moved. For example:
721
+ user-written code when they are copied or moved. Most commonly, types "care"
722
+ about the addresses of values because addresses of values are registered in
723
+ some global data structure, or because values may contain pointers into
724
+ themselves. For example:
722
725
723
726
* Addresses of values of Swift ``@weak `` types are registered in a global
724
727
table. That table needs to be adjusted when a ``@weak `` value is copied
725
728
or moved to a new address.
726
729
727
- * A non-COW collection type with a heap allocation needs to allocate memory
728
- and copy the collection elements when the collection is copied.
730
+ * A non-COW collection type with a heap allocation (like ``std::vector `` in
731
+ C++) needs to allocate memory and copy the collection elements when the
732
+ collection is copied.
729
733
730
- * A non-COW string type with an SSO buffer (like ``std::string `` in C++)
731
- can contain a pointer into the value itself. That pointer needs to be
732
- recomputed when the string is copied or moved.
734
+ * A non-COW string type that implements a small string optimization (like
735
+ many implementations of ``std::string `` in C++) can contain a pointer
736
+ into the value itself. That pointer needs to be recomputed when the
737
+ string is copied or moved.
733
738
734
739
Values of address-only type ("address-only values") must reside in
735
740
memory and can only be referenced in SIL by address. Addresses of
0 commit comments