1#![cfg_attr(not(any(feature = "std", test)), no_std)]
4#![deny(missing_docs)]
5
6#[cfg(any(feature = "std", test))]
7extern crate std;
8
9extern crate alloc;
10
11pub mod arena;
12pub mod numa;
13pub mod scratch;
14pub mod segment;
15
16pub use arena::{allocate_large_or_huge, deallocate_large_or_huge};
17pub use numa::{bind_segment_to_numa_node, current_numa_node};
18pub use scratch::{
19 AlignedBuf, AlignedVec, DEFAULT_SCRATCH_ALIGN, Drain, IntoIter, ScratchBank, ScratchElement,
20 ScratchPool,
21};
22pub use segment::{
23 AcquiredSegment, ArenaMemoryStats, GlobalHugePool, GlobalSegmentPool, HasSegmentPool,
24 HugePoolStats, MAX_RETAINED_SEGMENTS, SEGMENT_MAPPING_SIZE, SegmentPoolStats, acquire_segment,
25 allocate_segment, arena_memory_stats, checked_align_up, deallocate_segment, purge_segment_pool,
26 purge_segment_pool_with_warm, reset_segment_pool, try_deallocate_segment,
27};
28
29#[macro_export]
47macro_rules! aligned_vec {
48 () => {
49 $crate::AlignedVec::dangling()
50 };
51 ($elem:expr; $n:expr) => {
52 $crate::AlignedVec::filled($n, $elem)
53 };
54 ($($x:expr),+ $(,)?) => {{
55 let slice: &[_] = &[$($x),+];
56 $crate::AlignedVec::from_slice(slice)
57 }};
58}