Skip to content

Commit 7f68d6a

Browse files
committed
document the requirement that allocation alignments must be powers of two.
1 parent a5feb1a commit 7f68d6a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

stdlib/public/core/UnsafeRawBufferPointer.swift.gyb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ extension Unsafe${Mutable}RawBufferPointer {
271271
/// - Parameters:
272272
/// - byteCount: The number of bytes to allocate.
273273
/// - alignment: The alignment of the new region of allocated memory, in
274-
/// bytes.
274+
/// bytes. `alignment` must be a whole power of 2.
275275
/// - Returns: A buffer pointer to a newly allocated region of memory aligned
276276
/// to `alignment`.
277277
@inlinable

stdlib/public/core/UnsafeRawPointer.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,7 @@ public struct UnsafeMutableRawPointer: _Pointer, Sendable {
600600
/// - Parameters:
601601
/// - byteCount: The number of bytes to allocate. `byteCount` must not be negative.
602602
/// - alignment: The alignment of the new region of allocated memory, in
603-
/// bytes.
603+
/// bytes. `alignment` must be a whole power of 2.
604604
/// - Returns: A pointer to a newly allocated region of memory. The memory is
605605
/// allocated, but not initialized.
606606
@inlinable

0 commit comments

Comments
 (0)