Skip to content

Releases

v1.0.0

Choose a tag to compare

@github-actions github-actions released this 29 Jul 04:56

ArenaAllocator v1.0.0

The first stable release of ArenaAllocator, a fixed-capacity, bump-pointer memory arena for modern C++.

Highlights

  • O(1) bump-pointer allocation via allocate().
  • In-place construction and destruction of arbitrary types via create<T>() / destroy<T>().
  • RAII frame scopes via ArenaScope for automatic, exception-safe rollback.
  • Nested frame stack (beginFrame() / endFrame()) for stack-like, LIFO rollback of allocations.
  • reset() for O(1) bulk reclamation of the entire buffer.
  • Alignment-aware allocation, including over-aligned types.
  • Optional, zero-cost-when-disabled allocation statistics via a compile-time EnableStats flag.
  • Move construction and move assignment support.
  • Contract-based (assert-driven) precondition enforcement, documented consistently across the API.
  • Exception-safety: allocation and constructor failures propagate without corrupting arena state.

Performance

The implementation is designed with performance and memory efficiency in mind.

  • A single upfront buffer allocation eliminates per-allocation heap traffic.
  • Bump-pointer allocation keeps allocate() / create() to a handful of arithmetic operations.
  • Frame-based rollback reclaims an entire batch of allocations in O(1), without touching each one individually.
  • reset() reclaims the whole buffer in O(1), regardless of how many objects were allocated.
  • Exhaustion is a plain bounds check and a nullptr return — no exceptions, no reallocation.
  • Alignment is resolved via bit-shift arithmetic rather than a general modulo/division path.

Benchmarks

Measured against stdArena (a naive new[] + linear-scan baseline) at 10K / 100K / 1M
iterations. Full results: benchmarks/results/v1_0_0.md.

Operation ArenaPro (1M) stdArena (1M) Δ
Allocate() At Capacity (Failure Path) 308.34 us 1.76 s +569727.4%
Reset() + Refill 101.67 ms 14.16 s +13825.6%
Allocate() Large Type 821.41 us 1.63 ms +98.2%
Allocate() Large 680.08 us 1.27 ms +86.9%
Allocate() Over-aligned 770.38 us 1.27 ms +64.8%
Create() Non-trivial 3.03 ms 3.84 ms +26.6%
Allocate() 4096-byte Aligned 1.41 ms 1.76 ms +24.6%
Allocate() Small 1.11 ms 1.30 ms +17.2%
Destroy() Trivial 320.11 us 308.32 us -3.7%
Allocate() 4 KiB Buffer 2.66 ms 2.04 ms -23.3%
Construction 40.12 ms 7.47 ms -81.4%

ArenaPro's fixed-buffer, bump-pointer design pays off most on the exhaustion path
(a bounds check and a nullptr return versus stdArena actually growing), bulk
churn (Reset() + refill), and large or over-aligned allocations, where stdArena's
per-call bookkeeping shows up directly.

The trade-off: the buffer is allocated once, eagerly and aligned, at construction —
so Construction is consistently slower than stdArena's lazy setup, and small
buffers (Allocate() 4 KiB Buffer) don't fully amortize that upfront alignment cost
the way larger buffers do.

Testing

The project includes a comprehensive test suite covering:

  • Unit tests
  • Integration tests
  • Lifecycle tests
  • Move semantics
  • Regression tests
  • Exception safety
  • Allocation failure handling
  • Frame-based rollback and nested frames
  • ArenaScope RAII behavior
  • Alignment behavior
  • Statistics tracking
  • External synchronization contracts

Code Coverage

The current test suite achieves:

  • 99.1% line coverage
  • 100.0% function coverage

Coverage reports exclude test infrastructure and third-party dependencies, focusing on the ArenaPro library implementation.

Continuous Integration

Automated builds and tests are configured for:

  • GCC — Debug
  • GCC — Release
  • Clang — Debug
  • Clang — Release
  • MSVC — Debug
  • MSVC — Release
  • AppleClang — Debug
  • AppleClang — Release

Release

This release represents the first stable version of ArenaAllocator and establishes the initial API, memory-management design, testing infrastructure, and cross-platform CI pipeline.

Installation

Clone the repository and integrate ArenaAllocator into your C++ project using the provided CMake configuration.

See the project documentation for build instructions, API usage, and integration details.