@@ -288,8 +288,8 @@ public struct UnsafeRawPointer: _Pointer {
288
288
///
289
289
/// let count = 4
290
290
/// let bytesPointer = UnsafeMutableRawPointer.allocate(
291
- /// bytes : 100,
292
- /// alignedTo : MemoryLayout<Int8>.alignment)
291
+ /// byteCount : 100,
292
+ /// alignment : MemoryLayout<Int8>.alignment)
293
293
/// let int8Pointer = bytesPointer.bindMemory(to: Int8.self, capacity: count)
294
294
///
295
295
/// After calling `bindMemory(to:capacity:)`, the first four bytes of the
@@ -653,8 +653,8 @@ public struct UnsafeMutableRawPointer: _Pointer {
653
653
///
654
654
/// let count = 4
655
655
/// let bytesPointer = UnsafeMutableRawPointer.allocate(
656
- /// bytes : 100,
657
- /// alignedTo : MemoryLayout<Int8>.alignment)
656
+ /// byteCount : 100,
657
+ /// alignment : MemoryLayout<Int8>.alignment)
658
658
/// let int8Pointer = bytesPointer.bindMemory(to: Int8.self, capacity: count)
659
659
///
660
660
/// After calling `bindMemory(to:capacity:)`, the first four bytes of the
@@ -716,7 +716,7 @@ public struct UnsafeMutableRawPointer: _Pointer {
716
716
/// let bytesPointer = UnsafeMutableRawPointer.allocate(
717
717
/// byteCount: count * MemoryLayout<Int8>.stride,
718
718
/// alignment: MemoryLayout<Int8>.alignment)
719
- /// let int8Pointer = myBytes .initializeMemory(
719
+ /// let int8Pointer = bytesPointer .initializeMemory(
720
720
/// as: Int8.self, repeating: 0, count: count)
721
721
///
722
722
/// // After using 'int8Pointer':
@@ -764,8 +764,8 @@ public struct UnsafeMutableRawPointer: _Pointer {
764
764
///
765
765
/// let count = 4
766
766
/// let bytesPointer = UnsafeMutableRawPointer.allocate(
767
- /// bytes : count * MemoryLayout<Int8>.stride,
768
- /// alignedTo : MemoryLayout<Int8>.alignment)
767
+ /// byteCount : count * MemoryLayout<Int8>.stride,
768
+ /// alignment : MemoryLayout<Int8>.alignment)
769
769
/// let values: [Int8] = [1, 2, 3, 4]
770
770
/// let int8Pointer = values.withUnsafeBufferPointer { buffer in
771
771
/// return bytesPointer.initializeMemory(as: Int8.self,
@@ -776,7 +776,7 @@ public struct UnsafeMutableRawPointer: _Pointer {
776
776
/// // (int8Pointer + 3).pointee == 4
777
777
///
778
778
/// // After using 'int8Pointer':
779
- /// int8Pointer.deallocate(count )
779
+ /// int8Pointer.deallocate()
780
780
///
781
781
/// After calling this method on a raw pointer `p`, the region starting at
782
782
/// `p` and continuing up to `p + count * MemoryLayout<T>.stride` is bound
@@ -933,7 +933,7 @@ public struct UnsafeMutableRawPointer: _Pointer {
933
933
///
934
934
/// let typedPointer = p.bindMemory(to: U.self, capacity: 1)
935
935
/// typedPointer.deinitialize(count: 1)
936
- /// p.initializeMemory(as: T.self, to : newValue)
936
+ /// p.initializeMemory(as: T.self, repeating : newValue, count: 1 )
937
937
///
938
938
/// - Parameters:
939
939
/// - value: The value to store as raw bytes.
0 commit comments