mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
implement SE 184: add allocation methods to Unsafe buffer pointers, drop all parameters from deallocation, adjust namings, and add repeated-value assignment methods
This commit is contained in:
committed by
Andrew Trick
parent
c7d33e70d3
commit
c85880899d
@@ -101,9 +101,9 @@ extension _SwiftNativeNSArrayWithContiguousStorage : _NSArrayCore {
|
||||
// These objects are "returned" at +0, so treat them as pointer values to
|
||||
// avoid retains. Copy bytes via a raw pointer to circumvent reference
|
||||
// counting while correctly aliasing with all other pointer types.
|
||||
UnsafeMutableRawPointer(aBuffer).copyBytes(
|
||||
UnsafeMutableRawPointer(aBuffer).copyMemory(
|
||||
from: objects.baseAddress! + range.location,
|
||||
count: range.length * MemoryLayout<AnyObject>.stride)
|
||||
byteCount: range.length * MemoryLayout<AnyObject>.stride)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user