Skip to content

Commit d59ed0a

Browse files
authored
Minor Data updates (swiftlang#1704)
1 parent 75585a5 commit d59ed0a

3 files changed

Lines changed: 3 additions & 2 deletions

File tree

Sources/FoundationEssentials/Data/Data+Base64.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,7 @@ extension Base64 {
608608

609609
let outputLength = ((inBuffer.count + 3) / 4) * 3
610610

611-
let pointer = malloc(outputLength)
611+
let pointer = __DataStorage.allocate(outputLength, false)
612612
let other = pointer?.bindMemory(to: UInt8.self, capacity: outputLength)
613613
let target = UnsafeMutableBufferPointer(start: other, count: outputLength)
614614
var length = outputLength

Sources/FoundationEssentials/Data/Data.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@
4848
@usableFromInline let memcmp = WASILibc.memcmp
4949
#endif
5050

51+
#if !NO_CSHIMS
5152
internal import _FoundationCShims
53+
#endif
5254
import Builtin
5355

5456
#if canImport(Darwin)

Sources/FoundationEssentials/Platform.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ fileprivate let _pageSize: Int = Int(getpagesize())
4545
internal import CoreFoundation_Private
4646
#endif
4747

48-
4948
package struct Platform {
5049
static var pageSize: Int {
5150
_pageSize

0 commit comments

Comments
 (0)