Unify lazy atomics in entropy backends by tamird · Pull Request #804 · rust-random/getrandom (original) (raw)

newpavlov

tamird

newpavlov

@tamird

Replace ad-hoc atomic lazy caches with shared lazy helpers in the Linux/Android fallback, NetBSD, RDRAND, and RNDR backends. Add LazyPtr alongside LazyUsize and LazyBool so pointer and boolean caches use the same initialization contract.

This reduces duplicated cache logic and keeps backend probing/fallback semantics aligned while preserving the existing retry-until-cached behavior.

newpavlov

tamird

@tamird tamird deleted the cleanup-atomics branch

February 11, 2026 16:47

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})