Skip to content

Commit

Permalink
Avoid integer literals that won't fit. (#2348)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Lukasa authored Jan 13, 2023
1 parent c8ec84e commit 4ad2c37
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Tests/NIOCoreTests/ByteBufferTest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1756,9 +1756,9 @@ class ByteBufferTest: XCTestCase {

// This allocator assumes that we'll never call realloc.
let fakeAllocator = ByteBufferAllocator(
hookedMalloc: { _ in .init(bitPattern: 0xdeadbeef) },
hookedMalloc: { _ in .init(bitPattern: 0xdedbeef) },
hookedRealloc: { _, _ in fatalError() },
hookedFree: { precondition($0 == .init(bitPattern: 0xdeadbeef)!) },
hookedFree: { precondition($0 == .init(bitPattern: 0xdedbeef)!) },
hookedMemcpy: {_, _, _ in }
)

Expand Down

0 comments on commit 4ad2c37

Please sign in to comment.