From 7524acda0a8778572262429f27b359d7ee91fc90 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 7 Jan 2020 22:56:32 +0300 Subject: libmdbx: update to 0.5.0 --- libs/libmdbx/src/test/utils.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'libs/libmdbx/src/test/utils.cc') 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 * 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; -- cgit v1.2.3