apple/swift-nio
在 GitHub 查看NIOLoopBound should get `unchecked` variants that are truly free in release mode
Open
#2,506 建立於 2023年8月17日
good first issuekind/enhancement
描述
NIOLoopBound(Box) is super useful when adopting Sendable but the eventLoop.preconditionInEventLoop() checks everywhere are expensive and -- for repeated accesses -- unnecessary.
There should be unchecked variants of init, get and set value that do eventLoop.assertInEventLoop() instead. Together with @inlinable that should become completely free in release mode (and still check in debug).
Docs: