mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 05:44:20 +00:00
Allocator/Random: document that comparing ptr may result in illegal behavior
See #21756 and #17704
This commit is contained in:
parent
b46f9945a8
commit
4041cc06d5
2 changed files with 7 additions and 1 deletions
|
|
@ -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,
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,10 @@ const builtin = @import("builtin");
|
|||
pub const Error = error{OutOfMemory};
|
||||
pub const Log2Align = math.Log2Int(usize);
|
||||
|
||||
// The type erased pointer to the allocator implementation
|
||||
/// The type erased pointer to the allocator implementation.
|
||||
/// Any comparison of this field may result in illegal behavior, since it may be set to
|
||||
/// `undefined` in cases where the allocator implementation does not have any associated
|
||||
/// state.
|
||||
ptr: *anyopaque,
|
||||
vtable: *const VTable,
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue