Skip to content

arena: add public allocation interface#86

Closed
edsiper wants to merge 4 commits into
masterfrom
agent/public-arena-allocation
Closed

arena: add public allocation interface#86
edsiper wants to merge 4 commits into
masterfrom
agent/public-arena-allocation

Conversation

@edsiper

@edsiper edsiper commented Jul 12, 2026

Copy link
Copy Markdown
Member

Summary

  • expose raw request-lifetime allocation through cfl_arena_malloc() and cfl_arena_calloc()
  • add cfl_arena_memdup() and cfl_arena_strndup() helpers
  • add an options-based constructor with optional allocator callbacks and bounded geometric chunk growth
  • retain fixed-size chunks as the default and preserve the existing constructors
  • document alignment, zero-size, overflow, failure, reset, and lifetime semantics
  • extend unit, installed-consumer, and benchmark coverage

The arena remains opaque, and the API additions are source- and ABI-additive. Existing CFL arena users retain their current fixed-size allocation policy unless they explicitly select a larger maximum chunk size. This PR only provides the general interface; it does not migrate downstream consumers.

Validation

  • cmake -S . -B build-public-arena -DCFL_TESTS=On -DCFL_BENCHMARKS=On
  • cmake --build build-public-arena -j8
  • ctest --test-dir build-public-arena --output-on-failure (34/34 passed)
  • ASan/UBSan test suite with leak detection (34/34 passed)
  • focused arena tests under Valgrind (no leaks or errors)
  • installed-consumer configure, build, link, and execution
  • downstream builds/tests: cmetrics (20/20), ctraces (4/4), cprofiles (4/4)
  • Fluent Bit default build, including processor plugins
  • git diff --check

Benchmark support

The arena benchmark now compares fixed-size chunks with an optional bounded-growth mode. This is intended to support representative consumer-side measurements, including OTLP protobuf rendering, without claiming workload-specific performance from the synthetic benchmark alone.

edsiper added 4 commits July 11, 2026 18:07
Signed-off-by: Eduardo Silva <eduardo@chronosphere.io>
Signed-off-by: Eduardo Silva <eduardo@chronosphere.io>
Signed-off-by: Eduardo Silva <eduardo@chronosphere.io>
Signed-off-by: Eduardo Silva <eduardo@chronosphere.io>
@edsiper

edsiper commented Jul 12, 2026

Copy link
Copy Markdown
Member Author

Superseded by #87 using the project topic branch naming convention.

@edsiper edsiper closed this Jul 12, 2026
@edsiper edsiper deleted the agent/public-arena-allocation branch July 12, 2026 00:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant