MCPcopy Create free account
hub / github.com/apache/brpc / init_fast_rand_seed

Function init_fast_rand_seed

src/butil/fast_rand.cpp:54–58  ·  view source on GitHub ↗

seed xorshift128+ with splitmix64.

Source from the content-addressed store, hash-verified

52
53// seed xorshift128+ with splitmix64.
54void init_fast_rand_seed(FastRandSeed* seed) {
55 SplitMix64Seed seed4seed = butil::gettimeofday_us();
56 seed->s[0] = splitmix64_next(&seed4seed);
57 seed->s[1] = splitmix64_next(&seed4seed);
58}
59
60inline uint64_t fast_rand_impl(uint64_t range, FastRandSeed* seed) {
61 // Separating uint64_t values into following intervals:

Callers 6

UpdateTLSRandom64Function · 0.85
fast_randFunction · 0.85
fast_rand_less_thanFunction · 0.85
fast_rand_in_64Function · 0.85
fast_rand_in_u64Function · 0.85
fast_rand_doubleFunction · 0.85

Calls 2

splitmix64_nextFunction · 0.85
gettimeofday_usFunction · 0.70

Tested by

no test coverage detected