forked from OSchip/llvm-project
d202c76441
On Apple platforms, arc4random is faster than /dev/urandom, and it is the recommended user-space RNG according to Apple's own OS folks. This commit adds an ABI switch to guard ABI-break-protections in std::random_device, and starts using arc4random instead of /dev/urandom to implement std::random_device on Apple platforms. Note that previously, `std::random_device` would allow passing a custom token to its constructor, and that token would be interpreted as the name of a file to read entropy from. This was implementation-defined and undocumented. After this change, Apple platforms will be using arc4random() instead, and any custom token passed to the constructor will be ignored. This behavioral change will also impact other platforms that use the arc4random() implementation, such as OpenBSD. This should be fine since that is effectively a relaxation of the constructor's requirements. rdar://86638350 Differential Revision: https://reviews.llvm.org/D116045 |
||
---|---|---|
.. | ||
bernoulli_distribution.h | ||
binomial_distribution.h | ||
cauchy_distribution.h | ||
chi_squared_distribution.h | ||
clamp_to_integral.h | ||
default_random_engine.h | ||
discard_block_engine.h | ||
discrete_distribution.h | ||
exponential_distribution.h | ||
extreme_value_distribution.h | ||
fisher_f_distribution.h | ||
gamma_distribution.h | ||
generate_canonical.h | ||
geometric_distribution.h | ||
independent_bits_engine.h | ||
is_seed_sequence.h | ||
knuth_b.h | ||
linear_congruential_engine.h | ||
log2.h | ||
lognormal_distribution.h | ||
mersenne_twister_engine.h | ||
negative_binomial_distribution.h | ||
normal_distribution.h | ||
piecewise_constant_distribution.h | ||
piecewise_linear_distribution.h | ||
poisson_distribution.h | ||
random_device.h | ||
ranlux.h | ||
seed_seq.h | ||
shuffle_order_engine.h | ||
student_t_distribution.h | ||
subtract_with_carry_engine.h | ||
uniform_int_distribution.h | ||
uniform_random_bit_generator.h | ||
uniform_real_distribution.h | ||
weibull_distribution.h |