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
@@ -184,8 +184,8 @@ dump(randomUnsafeMutablePointerString)
|
||||
var sanePointerString = UnsafeMutablePointer<String>.allocate(capacity: 1)
|
||||
sanePointerString.initialize(to: "Hello panda")
|
||||
dump(sanePointerString.pointee)
|
||||
sanePointerString.deinitialize()
|
||||
sanePointerString.deallocate(capacity: 1)
|
||||
sanePointerString.deinitialize(count: 1)
|
||||
sanePointerString.deallocate()
|
||||
|
||||
// Don't crash on types with opaque metadata. rdar://problem/19791252
|
||||
// CHECK-NEXT: (Opaque Value)
|
||||
@@ -194,4 +194,3 @@ dump(rawPointer)
|
||||
|
||||
// CHECK-LABEL: and now our song is done
|
||||
print("and now our song is done")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user