Skip to content

Commit ab37099

Browse files
authored
Merge pull request #20686 from compnerd/alignment
stdlib: pass along alignment for dealloc
2 parents 694b153 + 381cae6 commit ab37099

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

stdlib/public/core/UnsafePointer.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,8 @@ public struct UnsafeMutablePointer<Pointee>: _Pointer {
580580
/// block. The memory must not be initialized or `Pointee` must be a trivial type.
581581
@inlinable
582582
public func deallocate() {
583-
Builtin.deallocRaw(_rawValue, (-1)._builtinWordValue, (-1)._builtinWordValue)
583+
Builtin.deallocRaw(_rawValue, (-1)._builtinWordValue,
584+
Builtin.alignof(Pointee.self))
584585
}
585586

586587
/// Accesses the instance referenced by this pointer.

0 commit comments

Comments
 (0)