Page MenuHomeFreeBSD

random(4): Translate a comment requirement into a compile-time invariant
ClosedPublic

Authored by cem on Sep 1 2018, 4:39 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Nov 21, 6:59 PM
Unknown Object (File)
Oct 28 2024, 12:02 PM
Unknown Object (File)
Oct 9 2024, 6:24 AM
Unknown Object (File)
Oct 5 2024, 9:46 PM
Unknown Object (File)
Oct 4 2024, 11:12 AM
Unknown Object (File)
Oct 2 2024, 9:46 PM
Unknown Object (File)
Oct 2 2024, 8:57 PM
Unknown Object (File)
Oct 2 2024, 7:30 PM
Subscribers

Details

Summary

In various places, random represents the set of sources as a 32-bit word
bitmask. It assumes all sources fit within this, i.e., the maximum valid
source number is 31.

There was a comment specifying this limitation, but we can actually refuse
to compile if our assumption is violated instead. We still have a few spare
random source slots, but sooner or later someone may need to convert the
masks used from raw 32-bit words to bitset(9) APIs.

This prevents some kinds of developer foot-shooting when adding new random
sources. No functional change.

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 19338
Build 18943: arc lint + arc unit