Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[arch] Add arm64_32 to the 32-bit platform check #2625

Merged
merged 2 commits into from
Jan 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Sources/NIOCore/ByteBuffer-int.swift
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ extension UInt32 {

var n = self

#if arch(arm) || arch(i386)
#if arch(arm) || arch(i386) || arch(arm64_32)
// on 32-bit platforms we can't make use of a whole UInt32.max (as it doesn't fit in an Int)
let max = UInt32(Int.max)
#else
Expand Down
2 changes: 1 addition & 1 deletion Sources/NIOWebSocket/WebSocketFrameEncoder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import NIOCore

private let maxOneByteSize = 125
private let maxTwoByteSize = Int(UInt16.max)
#if arch(arm) || arch(i386)
#if arch(arm) || arch(i386) || arch(arm64_32)
// on 32-bit platforms we can't put a whole UInt32 in an Int
private let maxNIOFrameSize = Int(UInt32.max / 2)
#else
Expand Down
2 changes: 1 addition & 1 deletion Tests/NIOCoreTests/ByteBufferTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1327,7 +1327,7 @@ class ByteBufferTest: XCTestCase {
}

func testAllocationOfReallyBigByteBuffer() throws {
#if arch(arm) || arch(i386)
#if arch(arm) || arch(i386) || arch(arm64_32)
// this test doesn't work on 32-bit platforms because the address space is only 4GB large and we're trying
// to make a 4GB ByteBuffer which just won't fit. Even going down to 2GB won't make it better.
return
Expand Down