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 (8,453 star) (749 fork)batch import
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:

貢獻者指南