Skip to content

Commit 4ad2c37

Browse files
authored
Avoid integer literals that won't fit. (#2348)
Motivation: While the "giant buffer" test doesn't run on 32-bit systems, it does need to compile. That means we can't set a pointer to a value that won't fit into an Int. Modifications: Smaller pointers! Result: The compile should work again.
1 parent c8ec84e commit 4ad2c37

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Tests/NIOCoreTests/ByteBufferTest.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1756,9 +1756,9 @@ class ByteBufferTest: XCTestCase {
17561756

17571757
// This allocator assumes that we'll never call realloc.
17581758
let fakeAllocator = ByteBufferAllocator(
1759-
hookedMalloc: { _ in .init(bitPattern: 0xdeadbeef) },
1759+
hookedMalloc: { _ in .init(bitPattern: 0xdedbeef) },
17601760
hookedRealloc: { _, _ in fatalError() },
1761-
hookedFree: { precondition($0 == .init(bitPattern: 0xdeadbeef)!) },
1761+
hookedFree: { precondition($0 == .init(bitPattern: 0xdedbeef)!) },
17621762
hookedMemcpy: {_, _, _ in }
17631763
)
17641764

0 commit comments

Comments
 (0)