Move random number re-seeding out of the hot path

Instead of checking if we need to re-seed for every isc_random call,
seed the random number generator in the libisc global initializer
and the per-thread initializer.
This commit is contained in:
Tony Finch
2022-04-22 14:35:36 +01:00
parent 254d2abafb
commit b1bb41603e
6 changed files with 47 additions and 17 deletions

View File

@@ -87,6 +87,11 @@ _setup(void **state) {
result = isc_test_begin(NULL, true, 0);
assert_int_equal(result, ISC_R_SUCCESS);
/*
* Ensure the RNG has been seeded.
*/
assert_int_not_equal(isc_random32(), 0);
return (0);
}