Skip to content

Commit

Permalink
Merge pull request #20686 from compnerd/alignment
Browse files Browse the repository at this point in the history
stdlib: pass along alignment for dealloc
  • Loading branch information
compnerd committed Nov 21, 2018
2 parents 694b153 + 381cae6 commit ab37099
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion stdlib/public/core/UnsafePointer.swift
Expand Up @@ -580,7 +580,8 @@ public struct UnsafeMutablePointer<Pointee>: _Pointer {
/// block. The memory must not be initialized or `Pointee` must be a trivial type.
@inlinable
public func deallocate() {
Builtin.deallocRaw(_rawValue, (-1)._builtinWordValue, (-1)._builtinWordValue)
Builtin.deallocRaw(_rawValue, (-1)._builtinWordValue,
Builtin.alignof(Pointee.self))
}

/// Accesses the instance referenced by this pointer.
Expand Down

0 comments on commit ab37099

Please sign in to comment.