Skip to content

Commit

Permalink
undo Xcode 13 GM workaround (#3092)
Browse files Browse the repository at this point in the history
### Motivation:

Xcode 13 is really quite old (3 major releases and it was the GM release
anyway) and this workaround can cause other issues.

### Modifications:

- Remove the Xcode 13 GM workaround.
- 
### Result:

Better, possibly faster code.
  • Loading branch information
weissi authored Jan 28, 2025
1 parent 1e900b4 commit dff4573
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 dff4573

Please sign in to comment.