Skip to main content

Crate forge_alloc_core

Crate forge_alloc_core 

Source
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:

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 FixedRange and Allocator.
traits
Foundation traits.

Structs§

AllocError
The AllocError error indicates an allocation failure that may be due to resource exhaustion or to something wrong when combining the given input arguments with this allocator.