Skip to content

Commit

Permalink
undo Xcode 13 GM workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
weissi committed Jan 28, 2025
1 parent 1e900b4 commit 6148a25
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions Sources/NIOCore/ByteBuffer-core.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,10 @@ import WASILibc
@usableFromInline let sysMalloc: @convention(c) (size_t) -> UnsafeMutableRawPointer? = malloc
@usableFromInline let sysRealloc: @convention(c) (UnsafeMutableRawPointer?, size_t) -> UnsafeMutableRawPointer? =
realloc

/// Xcode 13 GM shipped with a bug in the SDK that caused `free`'s first argument to be annotated as
/// non-nullable. To that end, we define a thunk through to `free` that matches that constraint, as we
/// never pass a `nil` pointer to it.
@usableFromInline let sysFree: @convention(c) (UnsafeMutableRawPointer) -> Void = { free($0) }
@inlinable
func sysFree(_ ptr: UnsafeMutableRawPointer) {
free(ptr)
}

extension _ByteBufferSlice: Equatable {}

Expand Down

0 comments on commit 6148a25

Please # to comment.