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, Feb 29, 2:50 PM
Unknown Object (File)
Jan 9 2024, 10:42 PM
Unknown Object (File)
Dec 20 2023, 12:39 AM
Unknown Object (File)
Dec 17 2023, 4:42 PM
Unknown Object (File)
Nov 24 2023, 11:22 AM
Unknown Object (File)
Nov 8 2023, 5:23 PM
Unknown Object (File)
Nov 5 2023, 5:27 AM
Unknown Object (File)
Oct 9 2023, 3:54 AM
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

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable