Expand description
§forge-alloc-core
Core trait contracts and primitive layout type for the forge-alloc
family of composable allocator crates.
Defines the foundation that the higher layers depend on:
Allocator/Deallocator— the split allocation traitNonZeroLayout— non-zero-size, power-of-two-align layout contractStdCompat— bridge toallocator_api2::alloc::AllocatorOsBacked/FixedRange— structural traits for backings and rangesFreelistProtection(+NoProtection, optionalSipHashMAC/PacMAC)AllocFaultPolicy— the OOM fault-injection seam for thehardeningFaultywrapper (+ built-in policies)CachePadded— target-aware cache-line alignment wrapper for contended atomics
Higher layers (the backing, layout, hardening modules) consume these
traits to produce primitive types; the forge-alloc crate re-exports
everything for convenience.
§testing module
Conformance helpers (testing::assert_fixed_range_invariants,
testing::assert_allocator_basic_round_trip, etc.) live under
testing for downstream crates that implement FixedRange or
Allocator and want a ready-made trait-contract validator in
their #[test] suite.
Re-exports§
pub use cache_padded::CachePadded;pub use cache_padded::CACHE_LINE;pub use traits::AllocFaultPolicy;pub use traits::Allocator;pub use traits::AlwaysFail;pub use traits::Deallocator;pub use traits::FailAfter;pub use traits::FailEveryNth;pub use traits::FailOnSize;pub use traits::FixedRange;pub use traits::FreelistCorruption;pub use traits::FreelistProtection;pub use traits::NeverFail;pub use traits::NoProtection;pub use traits::NonZeroLayout;pub use traits::OsBacked;pub use traits::ProtectFlags;pub use traits::StdCompat;pub use traits::SipHashMAC;
Modules§
- cache_
padded CachePadded<T>— target-aware cache-line alignment.- testing
- Conformance helpers for downstream impls of
FixedRangeandAllocator. - traits
- Foundation traits.
Structs§
- Alloc
Error - The
AllocErrorerror indicates an allocation failure that may be due to resource exhaustion or to something wrong when combining the given input arguments with this allocator.