1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//! Compile-time allocator behaviors and memory safety policies.
//!
//! # Zero-cost guarantee
//!
//! Every policy flag is a `const bool` associated item, not a runtime value.
//! Callers that specialize on `P::ENABLE_POISONING`, `P::ZERO_INITIALIZE`, etc.
//! will have those branches completely eliminated by the optimizer for
//! [`StandardPolicy`] (all false), leaving no overhead versus a hand-coded
//! non-poisoning allocator. The compile-time assertions in `impls` verify
//! this invariant at build time.
//!
//! # Module organization
//!
//! Every sub-module below is private; its public items are re-exported here.
//!
//! | Sub-module | Contents |
//! |------------|---------|
//! | [`mitigations`] | Compile-time bitmask constants for active mitigations |
//! | `private` | Sealed-trait infrastructure (not pub) |
//! | `alloc_policy` | `AllocPolicy` sealed trait definition |
//! | `impls` | `StandardPolicy`, `SecurePolicy`, `HardenedPolicy` ZSTs |
//! | `marker` | `PolicyMarker<P>` ZST typestate |
/// Sealed-trait infrastructure preventing out-of-crate `AllocPolicy` impls.
pub use AllocPolicy;
pub use ;
pub use PolicyMarker;