Skip to content

Commit dff4573

Browse files
authored
undo Xcode 13 GM workaround (#3092)
### 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.
1 parent 1e900b4 commit dff4573

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

Sources/NIOCore/ByteBuffer-core.swift

+4-5
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,10 @@ import WASILibc
3131
@usableFromInline let sysMalloc: @convention(c) (size_t) -> UnsafeMutableRawPointer? = malloc
3232
@usableFromInline let sysRealloc: @convention(c) (UnsafeMutableRawPointer?, size_t) -> UnsafeMutableRawPointer? =
3333
realloc
34-
35-
/// Xcode 13 GM shipped with a bug in the SDK that caused `free`'s first argument to be annotated as
36-
/// non-nullable. To that end, we define a thunk through to `free` that matches that constraint, as we
37-
/// never pass a `nil` pointer to it.
38-
@usableFromInline let sysFree: @convention(c) (UnsafeMutableRawPointer) -> Void = { free($0) }
34+
@inlinable
35+
func sysFree(_ ptr: UnsafeMutableRawPointer) {
36+
free(ptr)
37+
}
3938

4039
extension _ByteBufferSlice: Equatable {}
4140

0 commit comments

Comments
 (0)