We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8572437 commit 0c49fb1Copy full SHA for 0c49fb1
Foundation/URLSession/BodySource.swift
@@ -70,11 +70,9 @@ extension _BodyStreamSource : _BodySource {
70
guard inputStream.hasBytesAvailable else {
71
return .done
72
}
73
-
74
- let buffer = UnsafeMutableRawBufferPointer.allocate(count: length)
75
- defer {
76
- buffer.deallocate()
77
- }
+
+ let buffer = UnsafeMutableRawBufferPointer.allocate(byteCount: length, alignment: MemoryLayout<UInt8>.alignment)
+ defer { buffer.deallocate() }
78
79
guard let pointer = buffer.baseAddress?.assumingMemoryBound(to: UInt8.self) else {
80
return .error
0 commit comments