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:

贡献者指南