|
42 | 42 | public enum MemoryLayout<T> {
|
43 | 43 | /// The contiguous memory footprint of `T`, in bytes.
|
44 | 44 | ///
|
45 |
| - /// A type's size does not include any dynamically allocated or remote |
| 45 | + /// A type's size does not include any dynamically allocated or out of line |
46 | 46 | /// storage. In particular, `MemoryLayout<T>.size`, when `T` is a class
|
47 | 47 | /// type, is the same regardless of how many stored properties `T` has.
|
48 | 48 | ///
|
49 | 49 | /// When allocating memory for multiple instances of `T` using an unsafe
|
50 |
| - /// pointer, use a multiple of the type's `stride` property instead of its |
51 |
| - /// `size`. |
| 50 | + /// pointer, use a multiple of the type's stride instead of its size. |
52 | 51 | ///
|
53 | 52 | /// - SeeAlso: `stride`
|
54 | 53 | @_transparent
|
@@ -81,10 +80,10 @@ public enum MemoryLayout<T> {
|
81 | 80 | extension MemoryLayout {
|
82 | 81 | /// Returns the contiguous memory footprint of the given instance.
|
83 | 82 | ///
|
84 |
| - /// The result does not include any dynamically allocated or remote |
85 |
| - /// storage. In particular, `MemoryLayout.size(ofValue: x)`, when `x` is an |
86 |
| - /// instance of a class `C`, is the same regardless of how many stored |
87 |
| - /// properties `C` has. |
| 83 | + /// The result does not include any dynamically allocated or out of line |
| 84 | + /// storage. In particular, pointers and class instances all have the same |
| 85 | + /// contiguous memory footprint, regardless of the size of the referenced |
| 86 | + /// data. |
88 | 87 | ///
|
89 | 88 | /// When you have a type instead of an instance, use the
|
90 | 89 | /// `MemoryLayout<T>.size` static property instead.
|
|
0 commit comments