Skip to content

Commit 8ea3426

Browse files
committed
Update comment about arrayDestroy in pointer
1 parent 48ec9c6 commit 8ea3426

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

stdlib/public/core/UnsafePointer.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1166,8 +1166,8 @@ extension UnsafeMutablePointer where Pointee: ~Copyable {
11661166
@discardableResult
11671167
public func deinitialize(count: Int) -> UnsafeMutableRawPointer {
11681168
_debugPrecondition(count >= 0, "UnsafeMutablePointer.deinitialize with negative count")
1169-
// TODO: IRGen optimization when `count` value is statically known to be 1,
1170-
// then call `Builtin.destroy(Pointee.self, _rawValue)` instead.
1169+
// Note: When count is statically known to be 1 the compiler will optimize
1170+
// away a call to swift_arrayDestroy into the type's specific destroy.
11711171
Builtin.destroyArray(Pointee.self, _rawValue, count._builtinWordValue)
11721172
return UnsafeMutableRawPointer(self)
11731173
}

0 commit comments

Comments
 (0)