Skip to main content

zigzag_alloc/alloc/
mod.rs

1//! Memory allocator trait and concrete implementations.
2//!
3//! This module forms the allocation layer of the **zigzag** crate.  All
4//! collections in [`crate::collections`] are parameterised over an
5//! [`allocator::Allocator`] reference, so the concrete allocator type can be
6//! chosen at construction time without runtime polymorphism overhead.
7//!
8//! ## Available Allocators
9//!
10//! | Type | Module | Use case |
11//! |------|--------|----------|
12//! | [`system::SystemAllocator`] | `system` | General-purpose, delegates to `posix_memalign` / `_aligned_malloc` |
13//! | [`bump::BumpAllocator`] | `bump` | Fast linear allocation from a static buffer; no individual free |
14//! | [`arena::ArenaAllocator`] | `arena` | Per-block allocation with bulk free; useful for request-scoped data |
15//! | [`counting::CountingAllocator`] | `counting` | Transparent wrapper that records allocation statistics |
16//! | [`pool::PoolAllocator`] | `pool` | Fixed-size object pool with lock-free alloc / dealloc |
17
18pub mod allocator;
19pub mod system;
20pub mod bump;
21pub mod arena;
22pub mod counting;
23pub mod pool;