Skip to content

Commit 620066f

Browse files
authored
Merge pull request #1903 from compnerd/data
2 parents 531cca6 + a6c0614 commit 620066f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Foundation/Data.swift

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
#if DEPLOYMENT_RUNTIME_SWIFT
1414

15-
#if os(Linux)
15+
#if !canImport(Darwin)
1616
@inlinable // This is @inlinable as trivially computable.
1717
internal func malloc_good_size(_ size: Int) -> Int {
1818
return size
@@ -22,7 +22,11 @@ internal func malloc_good_size(_ size: Int) -> Int {
2222
import CoreFoundation
2323

2424
internal func __NSDataInvokeDeallocatorUnmap(_ mem: UnsafeMutableRawPointer, _ length: Int) {
25+
#if os(Windows)
26+
UnmapViewOfFile(mem)
27+
#else
2528
munmap(mem, length)
29+
#endif
2630
}
2731

2832
internal func __NSDataInvokeDeallocatorFree(_ mem: UnsafeMutableRawPointer, _ length: Int) {

0 commit comments

Comments
 (0)