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.
This commit is contained in:
Cory Benfield 2023-01-13 13:53:17 +00:00 committed by GitHub
parent c8ec84ef3b
commit 4ad2c37338
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

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