apple/swift-nio

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

オープン

#2,506 opened on 2023/08/17

 (5 件のコメント) (0 件のリアクション) (0 人の担当者)Swift (749 件のフォーク)batch import
good first issuekind/enhancement

Repository metrics

Stars
 (8,453 個のスター)
PR merge metrics
 (平均マージ 9d 10h) (30d で 15 merged PRs)

説明

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:

コントリビューターガイド