aboutsummaryrefslogtreecommitdiff
path: root/lib/std/Random.zig
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2025-02-04 13:35:59 -0800
committerGitHub <noreply@github.com>2025-02-04 13:35:59 -0800
commitd72f3d353f771daced78af70c049e3c5075b3529 (patch)
tree9ea04a955d5cd1b804eeefbb6568e77574a09eb0 /lib/std/Random.zig
parent3a4bb47fedbb890dc149622e31c75101b14c3b16 (diff)
parent4041cc06d5a0327c6d6d7e0bdec8516df06cb5ba (diff)
downloadzig-d72f3d353f771daced78af70c049e3c5075b3529.tar.gz
zig-d72f3d353f771daced78af70c049e3c5075b3529.zip
Merge pull request #22691 from squeek502/child-internal-array-list
Document that the `ptr` field of Allocator/Random should not be compared and remove existing comparison
Diffstat (limited to 'lib/std/Random.zig')
-rw-r--r--lib/std/Random.zig3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/std/Random.zig b/lib/std/Random.zig
index 8c68bdf6da..ae88d8b4fe 100644
--- a/lib/std/Random.zig
+++ b/lib/std/Random.zig
@@ -29,6 +29,9 @@ pub const RomuTrio = @import("Random/RomuTrio.zig");
pub const SplitMix64 = @import("Random/SplitMix64.zig");
pub const ziggurat = @import("Random/ziggurat.zig");
+/// Any comparison of this field may result in illegal behavior, since it may be set to
+/// `undefined` in cases where the random implementation does not have any associated
+/// state.
ptr: *anyopaque,
fillFn: *const fn (ptr: *anyopaque, buf: []u8) void,