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 |
||
---|---|---|
.. | ||
bit | ||
c.math | ||
cfenv/cfenv.syn | ||
complex.number | ||
numarray | ||
numbers | ||
numeric.ops | ||
numeric.requirements | ||
numerics.general | ||
rand |