mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +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
@@ -3315,7 +3315,7 @@ internal class _TypedNative${Self}Storage<${TypeParameters}> :
|
||||
if !_isPOD(Key.self) {
|
||||
for i in 0 ..< capacity {
|
||||
if initializedEntries[i] {
|
||||
(keys+i).deinitialize()
|
||||
(keys+i).deinitialize(count: 1)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3324,7 +3324,7 @@ internal class _TypedNative${Self}Storage<${TypeParameters}> :
|
||||
if !_isPOD(Value.self) {
|
||||
for i in 0 ..< capacity {
|
||||
if initializedEntries[i] {
|
||||
(values+i).deinitialize()
|
||||
(values+i).deinitialize(count: 1)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3729,9 +3729,9 @@ internal struct _Native${Self}Buffer<${TypeParameters}> {
|
||||
_sanityCheck(isInitializedEntry(at: i))
|
||||
defer { _fixLifetime(self) }
|
||||
|
||||
(keys + i).deinitialize()
|
||||
(keys + i).deinitialize(count: 1)
|
||||
%if Self == 'Dictionary':
|
||||
(values + i).deinitialize()
|
||||
(values + i).deinitialize(count: 1)
|
||||
%end
|
||||
_storage.initializedEntries[i] = false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user