Skip to content

Commit ef18d82

Browse files
authored
Merge pull request #72 from guoye-zhang/internal
Remove usable from inline and internal properties
2 parents 7e038be + 51e4fd8 commit ef18d82

File tree

2 files changed

+0
-65
lines changed

2 files changed

+0
-65
lines changed

Sources/HTTPTypes/HTTPFieldName.swift

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -557,53 +557,4 @@ extension HTTPField.Name {
557557
public static var xContentTypeOptions: Self {
558558
.init(rawName: "X-Content-Type-Options", canonicalName: "x-content-type-options")
559559
}
560-
561-
// Deprecated
562-
/// P3P
563-
static var p3P: Self { .init(rawName: "P3P", canonicalName: "p3p") }
564-
/// Pragma
565-
static var pragma: Self { .init(rawName: "Pragma", canonicalName: "pragma") }
566-
/// Timing-Allow-Origin
567-
static var timingAllowOrigin: Self { .init(rawName: "Timing-Allow-Origin", canonicalName: "timing-allow-origin") }
568-
/// X-Frame-Options
569-
static var xFrameOptions: Self { .init(rawName: "X-Frame-Options", canonicalName: "x-frame-options") }
570-
/// X-XSS-Protection
571-
static var xXSSProtection: Self { .init(rawName: "X-XSS-Protection", canonicalName: "x-xss-protection") }
572-
// Internal
573-
/// Alt-Svc
574-
static var altSvc: Self { .init(rawName: "Alt-Svc", canonicalName: "alt-svc") }
575-
/// Keep-Alive
576-
static var keepAlive: Self { .init(rawName: "Keep-Alive", canonicalName: "keep-alive") }
577-
/// Proxy-Connection
578-
static var proxyConnection: Self { .init(rawName: "Proxy-Connection", canonicalName: "proxy-connection") }
579-
/// Upgrade-Insecure-Requests
580-
static var upgradeInsecureRequests: Self {
581-
.init(rawName: "Upgrade-Insecure-Requests", canonicalName: "upgrade-insecure-requests")
582-
}
583-
/// Datagram-Flow-Id
584-
static var datagramFlowId: Self { .init(rawName: "Datagram-Flow-Id", canonicalName: "datagram-flow-id") }
585-
/// Capsule-Protocol
586-
static var capsuleProtocol: Self { .init(rawName: "Capsule-Protocol", canonicalName: "capsule-protocol") }
587-
/// Server-Connection-Id
588-
static var serverConnectionId: Self {
589-
.init(rawName: "Server-Connection-Id", canonicalName: "server-connection-id")
590-
}
591-
/// Client-Connection-Id
592-
static var clientConnectionId: Self {
593-
.init(rawName: "Client-Connection-Id", canonicalName: "client-connection-id")
594-
}
595-
/// Sec-CH-Background
596-
static var secCHBackground: Self { .init(rawName: "Sec-CH-Background", canonicalName: "sec-ch-background") }
597-
/// Sec-CH-Geohash
598-
static var secCHGeohash: Self { .init(rawName: "Sec-CH-Geohash", canonicalName: "sec-ch-geohash") }
599-
/// Client-Geohash
600-
static var clientGeohash: Self { .init(rawName: "Client-Geohash", canonicalName: "client-geohash") }
601-
/// Proxy-QUIC-Forwarding
602-
static var proxyQUICForwarding: Self {
603-
.init(rawName: "Proxy-QUIC-Forwarding", canonicalName: "proxy-quic-forwarding")
604-
}
605-
/// Proxy-Config-Epoch
606-
static var proxyConfigEpoch: Self { .init(rawName: "Proxy-Config-Epoch", canonicalName: "proxy-config-epoch") }
607-
/// Connect-UDP-Bind
608-
static var connectUDPBind: Self { .init(rawName: "Connect-UDP-Bind", canonicalName: "connect-udp-bind") }
609560
}

Sources/HTTPTypes/NIOLock.swift

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -46,21 +46,16 @@ import wasi_pthread
4646
#endif
4747

4848
#if os(Windows)
49-
@usableFromInline
5049
typealias LockPrimitive = SRWLOCK
5150
#elseif canImport(Darwin)
52-
@usableFromInline
5351
typealias LockPrimitive = os_unfair_lock
5452
#else
55-
@usableFromInline
5653
typealias LockPrimitive = pthread_mutex_t
5754
#endif
5855

59-
@usableFromInline
6056
enum LockOperations {}
6157

6258
extension LockOperations {
63-
@inlinable
6459
static func create(_ mutex: UnsafeMutablePointer<LockPrimitive>) {
6560
mutex.assertValidAlignment()
6661

@@ -77,7 +72,6 @@ extension LockOperations {
7772
#endif
7873
}
7974

80-
@inlinable
8175
static func destroy(_ mutex: UnsafeMutablePointer<LockPrimitive>) {
8276
mutex.assertValidAlignment()
8377

@@ -91,7 +85,6 @@ extension LockOperations {
9185
#endif
9286
}
9387

94-
@inlinable
9588
static func lock(_ mutex: UnsafeMutablePointer<LockPrimitive>) {
9689
mutex.assertValidAlignment()
9790

@@ -105,7 +98,6 @@ extension LockOperations {
10598
#endif
10699
}
107100

108-
@inlinable
109101
static func unlock(_ mutex: UnsafeMutablePointer<LockPrimitive>) {
110102
mutex.assertValidAlignment()
111103

@@ -148,10 +140,8 @@ extension LockOperations {
148140
// and future maintainers will be happier that we were cautious.
149141
//
150142
// See also: https://github.com/apple/swift/pull/40000
151-
@usableFromInline
152143
final class LockStorage<Value>: ManagedBuffer<Value, LockPrimitive> {
153144

154-
@inlinable
155145
static func create(value: Value) -> Self {
156146
let buffer = Self.create(minimumCapacity: 1) { _ in
157147
value
@@ -168,35 +158,30 @@ final class LockStorage<Value>: ManagedBuffer<Value, LockPrimitive> {
168158
return storage
169159
}
170160

171-
@inlinable
172161
func lock() {
173162
self.withUnsafeMutablePointerToElements { lockPtr in
174163
LockOperations.lock(lockPtr)
175164
}
176165
}
177166

178-
@inlinable
179167
func unlock() {
180168
self.withUnsafeMutablePointerToElements { lockPtr in
181169
LockOperations.unlock(lockPtr)
182170
}
183171
}
184172

185-
@inlinable
186173
deinit {
187174
self.withUnsafeMutablePointerToElements { lockPtr in
188175
LockOperations.destroy(lockPtr)
189176
}
190177
}
191178

192-
@inlinable
193179
func withLockPrimitive<T>(_ body: (UnsafeMutablePointer<LockPrimitive>) throws -> T) rethrows -> T {
194180
try self.withUnsafeMutablePointerToElements { lockPtr in
195181
try body(lockPtr)
196182
}
197183
}
198184

199-
@inlinable
200185
func withLockedValue<T>(_ mutate: (inout Value) throws -> T) rethrows -> T {
201186
try self.withUnsafeMutablePointers { valuePtr, lockPtr in
202187
LockOperations.lock(lockPtr)
@@ -209,7 +194,6 @@ final class LockStorage<Value>: ManagedBuffer<Value, LockPrimitive> {
209194
extension LockStorage: @unchecked Sendable {}
210195

211196
extension UnsafeMutablePointer {
212-
@inlinable
213197
func assertValidAlignment() {
214198
assert(UInt(bitPattern: self) % UInt(MemoryLayout<Pointee>.alignment) == 0)
215199
}

0 commit comments

Comments
 (0)