15 "Override the random seed for debugging.");
18 uint64_t seed = FLAG_random_seed;
22 if (!
callback(
reinterpret_cast<uint8_t*
>(&seed),
sizeof(seed))) {
35void Random::Initialize(uint64_t seed) {
56uint64_t Random::NextState() {
57 const uint64_t MASK_32 = 0xffffffff;
58 const uint64_t
A = 0xffffda61;
60 uint64_t old_state = _state;
62 const uint64_t state_lo = old_state & MASK_32;
63 const uint64_t state_hi = (old_state >> 32) & MASK_32;
64 const uint64_t new_state = (
A * state_lo) + state_hi;
65 if (_state.compare_exchange_weak(old_state, new_state,
66 std::memory_order_relaxed,
67 std::memory_order_relaxed)) {
74 const uint64_t MASK_32 = 0xffffffff;
75 return static_cast<uint32_t
>(NextState() & MASK_32);
101 uint64_t mantissa =
NextUInt64() & 0xFFFFFFFFFFFFF;
103 const uint64_t exp = 1023;
104 return bit_cast<double>(exp << 52 | mantissa) - 1.0;
static Dart_EntropySource entropy_source_callback()
static int64_t GetCurrentTimeMicros()
static uint64_t GlobalNextUInt64()
bool(* Dart_EntropySource)(uint8_t *buffer, intptr_t length)
FlKeyEvent uint64_t FlKeyResponderAsyncCallback callback
static Mutex * global_random_mutex
DEFINE_FLAG(bool, print_cluster_information, false, "Print information about clusters written to snapshot")
static Random * global_random
NOT_IN_PRODUCT(LibraryPtr ReloadTestScript(const char *script))