apple/swift-nio

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

Ouverte

#2 506 ouverte le 17 août 2023

 (5 commentaires) (0 réaction) (0 personne assignée)Swift (749 forks)batch import
good first issuekind/enhancement

Métriques du dépôt

Stars
 (8 453 étoiles)
Métriques de merge PR
 (Merge moyen 9j 10h) (15 PRs mergées en 30 j)

Description

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:

Guide contributeur