Skip to content

Commit a14daa0

Browse files
committed
[stdlib] Address feedback from @gottesmm
1 parent e070568 commit a14daa0

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

stdlib/public/core/Builtin.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,8 @@ func _canBeClass<T>(_: T.Type) -> Int8 {
8484
///
8585
/// Only use this function to convert the instance passed as `x` to a
8686
/// layout-compatible type when the conversion is not possible through other
87-
/// means.
87+
/// means. Common conversions that are supported by the standard library
88+
/// include the following:
8889
///
8990
/// - To convert an integer value from one type to another, use an initializer
9091
/// or the `numericCast(_:)` function.

stdlib/public/core/MemoryLayout.swift

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,12 @@
4242
public enum MemoryLayout<T> {
4343
/// The contiguous memory footprint of `T`, in bytes.
4444
///
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
4646
/// storage. In particular, `MemoryLayout<T>.size`, when `T` is a class
4747
/// type, is the same regardless of how many stored properties `T` has.
4848
///
4949
/// 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.
5251
///
5352
/// - SeeAlso: `stride`
5453
@_transparent
@@ -81,10 +80,10 @@ public enum MemoryLayout<T> {
8180
extension MemoryLayout {
8281
/// Returns the contiguous memory footprint of the given instance.
8382
///
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.
8887
///
8988
/// When you have a type instead of an instance, use the
9089
/// `MemoryLayout<T>.size` static property instead.

0 commit comments

Comments
 (0)