Skip to main content

Module arena

Module arena 

Source
Expand description

Arena allocator for batch operations

This module provides arena-based memory allocation to reduce allocation overhead in hot paths and improve memory locality.

§Features (ADR-001)

  • Cache-aligned allocations: All allocations are aligned to cache line boundaries (64 bytes)
  • Bump allocation: O(1) allocation with minimal overhead
  • Batch deallocation: Free all allocations at once via reset()
  • Thread-local arenas: Per-thread allocation without synchronization

Structs§

Arena
Arena allocator for temporary allocations
ArenaVec
Vector allocated from an arena
BatchVectorAllocator
Batch vector allocator for processing multiple vectors (ADR-001)
CacheAlignedVec
Get the thread-local arena Note: Commented out due to lifetime issues with RefCell::borrow() escaping closure Use THREAD_ARENA.with(|arena| { … }) directly instead Cache-aligned vector storage for SIMD operations (ADR-001)

Constants§

CACHE_LINE_SIZE
Cache line size (typically 64 bytes on modern CPUs)