Skip to content

Commit bba530d

Browse files
authored
Merge pull request #259 from ishkawa/deallocate-entire-heap-blocks
Use buffer.deallocate() instead of buffer.deallocate(capacity:) in Swift 4.1 or later
2 parents 89ab5a5 + c2bb90d commit bba530d

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

Sources/APIKit/BodyParameters/Data+InputStream.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,11 @@ extension Data {
2929
}
3030
} while readSize > 0
3131

32+
#if swift(>=4.1)
33+
buffer.deallocate()
34+
#else
3235
buffer.deallocate(capacity: bufferSize)
36+
#endif
3337

3438
self.init(data)
3539
}

0 commit comments

Comments
 (0)