diff options
author | George Hazan <ghazan@miranda.im> | 2020-01-07 22:56:32 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2020-01-07 22:56:39 +0300 |
commit | 7524acda0a8778572262429f27b359d7ee91fc90 (patch) | |
tree | 6443228a439b83c5bc6d15923a9ccd91fa4718e3 /libs/libmdbx/src/test/utils.cc | |
parent | 62c842df372abe0349f025ac4cbbc8426526ac8b (diff) |
libmdbx: update to 0.5.0
Diffstat (limited to 'libs/libmdbx/src/test/utils.cc')
-rw-r--r-- | libs/libmdbx/src/test/utils.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libs/libmdbx/src/test/utils.cc b/libs/libmdbx/src/test/utils.cc index d9b3538b99..311cf544ef 100644 --- a/libs/libmdbx/src/test/utils.cc +++ b/libs/libmdbx/src/test/utils.cc @@ -1,4 +1,4 @@ -/* +/* * Copyright 2017-2019 Leonid Yuriev <leo@yuriev.ru> * and other libmdbx authors: please see AUTHORS file. * All rights reserved. @@ -331,6 +331,9 @@ double double_from_upper(uint64_t salt) { } bool flipcoin() { return bleach32((uint32_t)entropy_ticks()) & 1; } +bool flipcoin_x2() { return (bleach32((uint32_t)entropy_ticks()) & 3) == 0; } +bool flipcoin_x3() { return (bleach32((uint32_t)entropy_ticks()) & 7) == 0; } +bool flipcoin_x4() { return (bleach32((uint32_t)entropy_ticks()) & 15) == 0; } bool jitter(unsigned probability_percent) { const uint32_t top = UINT32_MAX - UINT32_MAX % 100; |