lib/alloc/phase/src/capacity/phase.zig
daab053ee43316e1809a84551d573ddd1e5bf3d2
1 /// Defines the lifecycle phases shared across allocator guards:
2 /// `initialization`, `steady`, and `teardown`. Runtime guards use these values
3 /// to classify incoming raw allocator calls. Under this classification,
4 /// `initialization` permits every raw operation, `steady` marks all raw
5 /// operations as violations, and `teardown` permits only deallocations while
6 /// marking allocations, resizes, and remaps as violations. Depending on the
7 /// selected guard type, a violation either triggers an immediate panic or
8 /// increments audit counters before forwarding the call to the backing
9 /// allocator. The enumeration itself is an unadorned data type that enforces no
10 /// transition rules or operational policies on other owners.
11 pub const Phase = enum(u8) {
12 initialization,
13 steady,
14 teardown,
15 };