You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`UnsafeMutableRawPointer.deallocate` invokes `Builtin.deallocRaw` with -1 for the alignment mask. This gets lowered to a call to `swift_slowDealloc`. This will inspect the alignment and select between invoking `free` and `AlignedFree`. This happens to work on macOS and Linux as you invoke `free` on both `malloc` results as well as `posix_memalign` results. However, on Windows, this is not the case. We need to match the `malloc` with `free` and `_aligned_alloc` with `_aligned_free`. Since we do not preserve the memory alignment, we end up invoking the wrong `free` function with the memory.
The text was updated successfully, but these errors were encountered:
Additional Detail from JIRA
md5: 17f0c1f5303061ada2b9db8c6260b0bf
Parent-Task:
Issue Description:
`UnsafeMutableRawPointer.deallocate` invokes `Builtin.deallocRaw` with
-1
for the alignment mask. This gets lowered to a call to `swift_slowDealloc`. This will inspect the alignment and select between invoking `free` and `AlignedFree`. This happens to work on macOS and Linux as you invoke `free` on both `malloc` results as well as `posix_memalign` results. However, on Windows, this is not the case. We need to match the `malloc` with `free` and `_aligned_alloc` with `_aligned_free`. Since we do not preserve the memory alignment, we end up invoking the wrong `free` function with the memory.The text was updated successfully, but these errors were encountered: