mirror of
https://github.com/apple/swift-nio
synced 2026-11-27 05:04:22 +00:00
SelectableEventLoop: make Darwin the special case (#1449)
Treat the `autoreleasepool` case for Darwin as the special case rather than Linux as the special case. This is following the case throughout the rest of the code base. This is also needed for the Windows port.
This commit is contained in:
1 parent
ad0c671acf
commit
e5298263ec
1 file changed
+4
-4
@@ -18,13 +18,13 @@ import NIOConcurrencyHelpers
|
||||
/// Execute the given closure and ensure we release all auto pools if needed.
|
||||
@inlinable
|
||||
internal func withAutoReleasePool<T>(_ execute: () throws -> T) rethrows -> T {
|
||||
#if os(Linux)
|
||||
return try execute()
|
||||
#else
|
||||
#if os(iOS) || os(macOS) || os(tvOS) || os(watchOS)
|
||||
return try autoreleasepool {
|
||||
try execute()
|
||||
}
|
||||
#endif
|
||||
#else
|
||||
return try execute()
|
||||
#endif
|
||||
}
|
||||
|
||||
/// `EventLoop` implementation that uses a `Selector` to get notified once there is more I/O or tasks to process.
|
||||
|
||||
Reference in new issue
Block a user