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

Function need_init

src/butil/fast_rand.cpp:85–87  ·  view source on GitHub ↗

True if the seed is (probably) uninitialized. There's definitely false positive, but it's OK for us.

Source from the content-addressed store, hash-verified

83// True if the seed is (probably) uninitialized. There's definitely false
84// positive, but it's OK for us.
85inline bool need_init(const FastRandSeed& seed) {
86 return seed.s[0] == 0 && seed.s[1] == 0;
87}
88
89uint64_t fast_rand() {
90 if (need_init(_tls_seed)) {

Callers 5

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

no outgoing calls

Tested by

no test coverage detected