Skip to content

Commit b384bf9

Browse files
committed
Addressed code review comments
1 parent 6972e38 commit b384bf9

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

docs/SIL.rst

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -718,18 +718,23 @@ generic constraints:
718718
* @weak types
719719
* Types that can't satisfy the requirements for being loadable because they
720720
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:
722725

723726
* Addresses of values of Swift ``@weak`` types are registered in a global
724727
table. That table needs to be adjusted when a ``@weak`` value is copied
725728
or moved to a new address.
726729

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.
729733

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.
733738

734739
Values of address-only type ("address-only values") must reside in
735740
memory and can only be referenced in SIL by address. Addresses of

0 commit comments

Comments
 (0)