alloc_phase.PhaseViolations
Internal implementation documentation
Defined in alloc_phase.
Represents a by-value snapshot of four operation counters: allocations, resizes, remaps, and frees.
API (5)
Actions
Public operations.
total: Returns the combined count of allocations, resizes, remaps, and frees as an unsigned 64-bit integer.
Fields and members
Public fields and members.
Source
Source: lib/alloc/phase/src/allocator.zig:285
zig
/// Represents a by-value snapshot of four operation counters: allocations,/// resizes, remaps, and frees. Each field is an unsigned 64-bit integer/// recording the number of times caller code attempted that raw allocator/// operation outside the permitted lifecycle phase. These values count/// attempted operations rather than allocated byte quantities or successful/// allocations. Because the underlying control block maintains these counts in/// native atomic variables that are read individually, a snapshot retrieved/// during concurrent operations does not represent a single coherent point in/// time across all four fields.pub const PhaseViolations = struct { allocations: u64 = 0, resizes: u64 = 0, remaps: u64 = 0, frees: u64 = 0, /// Returns the combined count of allocations, resizes, remaps, and frees as /// an unsigned 64-bit integer. The calculation uses standard addition, so /// integer overflow follows Zig build safety rules rather than saturating /// or reporting an error. pub fn total(self: PhaseViolations) u64 { return self.allocations + self.resizes + self.remaps + self.frees; }};Source: lib/alloc/phase/src/root.zig:145
zig
/// Represents a by-value snapshot of four operation counters: allocations,/// resizes, remaps, and frees. Each field is an unsigned 64-bit integer/// recording the number of times caller code attempted that raw allocator/// operation outside the permitted lifecycle phase. These values count/// attempted operations rather than allocated byte quantities or successful/// allocations. Because the underlying control block maintains these counts in/// native atomic variables that are read individually, a snapshot retrieved/// during concurrent operations does not represent a single coherent point in/// time across all four fields.pub const PhaseViolations = allocator.PhaseViolations;Audit
| Definitions | 2 |
|---|---|
| Public names | 2 |
| Members | 4 |
| Version | 26.7.0 |
| Revision | daab053ee433 |