We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a7cef0b commit f1da89aCopy full SHA for f1da89a
src/libstd/sys/unix/rand.rs
@@ -99,6 +99,13 @@ mod imp {
99
}
100
101
102
+// On iOS and MacOS `SecRandomCopyBytes` calls `CCRandomCopyBytes` with
103
+// `kCCRandomDefault`. `CCRandomCopyBytes` manages a CSPRNG which is seeded
104
+// from `/dev/random` and which runs on its own thread accessed via GCD.
105
+// This seems needlessly heavyweight for the purposes of generating two u64s
106
+// once per thread in `hashmap_random_keys`. Therefore `SecRandomCopyBytes` is
107
+// only used on iOS where direct access to `/dev/urandom` is blocked by the
108
+// sandbox.
109
#[cfg(target_os = "ios")]
110
mod imp {
111
use crate::io;
0 commit comments