apple/swift-nio

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

开放

#2,506 创建于 2023年8月17日

 (5 条评论) (0 个反应) (0 位负责人)Swift (749 个派生)batch import
good first issuekind/enhancement

仓库指标

星标
 (8,453 个星标)
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:

贡献者指南