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:
Saleem Abdulrasool authored and GitHub committed 2020-03-16 09:14:21 +00:00
1 parent ad0c671acf
commit e5298263ec
1 file changed
+4 -4
+4 -4
View File
@@ -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.