apple/swift-nio

NIOLoopBound should get `unchecked` variants that are truly free in release mode

Open

#2,506 建立於 2023年8月17日

在 GitHub 查看
 (5 留言) (0 反應) (0 負責人)Swift (749 fork)batch import
good first issuekind/enhancement

倉庫指標

Star
 (8,453 star)
PR 合併指標
 (平均合併 9天 10小時) (30 天內合併 15 個 PR)

描述

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:

貢獻者指南