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
@@ -81,7 +81,7 @@ final class TestManagedBuffer<T> : ManagedBuffer<CountAndCapacity, T> {
|
||||
withUnsafeMutablePointerToElements {
|
||||
(x: UnsafeMutablePointer<T>) -> () in
|
||||
for i in stride(from: 0, to: count, by: 2) {
|
||||
(x + i).deinitialize()
|
||||
(x + i).deinitialize(count: 1)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -104,7 +104,7 @@ class MyBuffer<T> {
|
||||
Manager(unsafeBufferObject: self).withUnsafeMutablePointers {
|
||||
(pointerToHeader, pointerToElements) -> Void in
|
||||
pointerToElements.deinitialize(count: self.count)
|
||||
pointerToHeader.deinitialize()
|
||||
pointerToHeader.deinitialize(count: 1)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user