Rename ArenaAllocator -> Arena

This commit is contained in:
2025-09-05 17:57:04 -04:00
parent 46fe51c0bb
commit f56ed2bfbe
22 changed files with 267 additions and 279 deletions

View File

@@ -1,4 +1,4 @@
#include "arena_allocator.hpp"
#include "arena.hpp"
#include "format.hpp"
#include <cstdio>
#include <iomanip>
@@ -26,7 +26,7 @@ void benchmark_simple_concatenation() {
ankerl::nanobench::Bench bench;
bench.title("Simple Concatenation").unit("op").warmup(100);
ArenaAllocator arena(64);
Arena arena(64);
// Arena-based static_format
bench.run("static_format", [&] {
auto result = static_format(arena, "Hello ", "World", "!");
@@ -65,7 +65,7 @@ void benchmark_mixed_types() {
ankerl::nanobench::Bench bench;
bench.title("Mixed Types").unit("op").warmup(100);
ArenaAllocator arena(128);
Arena arena(128);
// Arena-based static_format
bench.run("static_format", [&] {
auto result =
@@ -106,7 +106,7 @@ void benchmark_complex_formatting() {
ankerl::nanobench::Bench bench;
bench.title("Complex Formatting").unit("op").warmup(100);
ArenaAllocator arena(128);
Arena arena(128);
// Arena-based format (static_format doesn't support printf specifiers)
bench.run("format", [&] {
auto result = format(arena, "%-10s %5d %8.2f", TEST_STRING.c_str(),
@@ -147,7 +147,7 @@ void benchmark_error_messages() {
constexpr int line_number = 123;
const std::string error_msg = "File not found";
ArenaAllocator arena(128);
Arena arena(128);
// Arena-based static_format (using string literals only)
bench.run("static_format", [&] {
auto result = static_format(arena, "Error ", error_code, ": ",
@@ -188,7 +188,7 @@ void benchmark_double_formatting() {
std::cout << "\n=== Simple Double Formatting ===\n";
// Validate that all formatters produce identical output
ArenaAllocator arena(128);
Arena arena(128);
auto static_result = static_format(arena, TEST_DOUBLE);
auto format_result = format(arena, "%.17g", TEST_DOUBLE);