apple/swift-nio

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

Aberta

#2.506 aberto em 17 de ago. de 2023

 (5 comentários) (0 reação) (0 responsável)Swift (749 forks)batch import
good first issuekind/enhancement

Métricas do repositório

Stars
 (8.453 estrelas)
Métricas de merge de PR
 (Mesclagem média 9d 10h) (15 fundiu PRs em 30d)

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:

Guia do colaborador