# furkankirat/arena-allocator architecture

> Architecture diagram of the GitHub repository furkankirat/arena-allocator, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/furkankirat/arena-allocator
- Repository: https://github.com/furkankirat/arena-allocator

## Overview

This is a small header-only C++20 arena allocator, not a multi-service application. Its principal workflow is that a game or other client creates an arena, allocates aligned raw memory or typed objects, then reclaims temporary allocations by resetting the arena or rewinding to a marker. The header also provides array allocation, usage metrics, and move-only ownership of the backing block. The graph reflects the single sampled runtime header; usage examples and other capabilities are documented in the README.

Main entry points: [`include/arena_allocator.h`](https://github.com/furkankirat/arena-allocator/blob/main/include/arena_allocator.h) (Arena allocator)

## Diagram (Mermaid)

```mermaid
flowchart TD

node_client(("Game/client"))
node_arena["Arena allocator<br/>[arena_allocator.h]"]
node_storage[("Backing memory<br/>[arena_allocator.h]")]
node_raw["Aligned allocation<br/>[arena_allocator.h]"]
node_typed["Typed construction<br/>[arena_allocator.h]"]
node_arrays["Array allocation<br/>[arena_allocator.h]"]
node_reset["Arena reset<br/>[arena_allocator.h]"]
node_markers["Marker rewind<br/>[arena_allocator.h]"]
node_metrics["Usage metrics<br/>[arena_allocator.h]"]

node_client -->|"creates and uses"| node_arena
node_arena -->|"owns and releases"| node_storage
node_arena -->|"exposes"| node_raw
node_typed -->|"allocates via"| node_raw
node_arrays -->|"allocates via"| node_raw
node_client -->|"requests objects"| node_typed
node_client -->|"requests arrays"| node_arrays
node_client -->|"reclaims allocations"| node_reset
node_client -->|"saves and rewinds"| node_markers
node_client -->|"queries usage"| node_metrics
node_reset -->|"rewinds offset"| node_arena
node_markers -->|"reads or sets offset"| node_arena
node_metrics -->|"reads size and offset"| node_arena

click node_arena "https://github.com/furkankirat/arena-allocator/blob/main/include/arena_allocator.h"
click node_storage "https://github.com/furkankirat/arena-allocator/blob/main/include/arena_allocator.h"
click node_raw "https://github.com/furkankirat/arena-allocator/blob/main/include/arena_allocator.h"
click node_typed "https://github.com/furkankirat/arena-allocator/blob/main/include/arena_allocator.h"
click node_arrays "https://github.com/furkankirat/arena-allocator/blob/main/include/arena_allocator.h"
click node_reset "https://github.com/furkankirat/arena-allocator/blob/main/include/arena_allocator.h"
click node_markers "https://github.com/furkankirat/arena-allocator/blob/main/include/arena_allocator.h"
click node_metrics "https://github.com/furkankirat/arena-allocator/blob/main/include/arena_allocator.h"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_client toneBlue
class node_arena,node_raw,node_typed,node_arrays,node_reset,node_markers,node_metrics toneTeal
class node_storage toneAmber
```

## Components

### Other components

- **Game/client**
- [Arena allocator](https://github.com/furkankirat/arena-allocator/blob/main/include/arena_allocator.h): `include/arena_allocator.h`
- [Backing memory](https://github.com/furkankirat/arena-allocator/blob/main/include/arena_allocator.h): `include/arena_allocator.h`
- [Aligned allocation](https://github.com/furkankirat/arena-allocator/blob/main/include/arena_allocator.h): `include/arena_allocator.h`
- [Typed construction](https://github.com/furkankirat/arena-allocator/blob/main/include/arena_allocator.h): `include/arena_allocator.h`
- [Array allocation](https://github.com/furkankirat/arena-allocator/blob/main/include/arena_allocator.h): `include/arena_allocator.h`
- [Arena reset](https://github.com/furkankirat/arena-allocator/blob/main/include/arena_allocator.h): `include/arena_allocator.h`
- [Marker rewind](https://github.com/furkankirat/arena-allocator/blob/main/include/arena_allocator.h): `include/arena_allocator.h`
- [Usage metrics](https://github.com/furkankirat/arena-allocator/blob/main/include/arena_allocator.h): `include/arena_allocator.h`

## Connections

- Game/client → Arena allocator: creates and uses (evidence: `README.md`)
- Arena allocator → Backing memory: owns and releases (evidence: `include/arena_allocator.h`)
- Arena allocator → Aligned allocation: exposes (evidence: `include/arena_allocator.h`)
- Typed construction → Aligned allocation: allocates via (evidence: `include/arena_allocator.h`)
- Array allocation → Aligned allocation: allocates via (evidence: `include/arena_allocator.h`)
- Game/client → Typed construction: requests objects (evidence: `README.md`)
- Game/client → Array allocation: requests arrays (evidence: `README.md`)
- Game/client → Arena reset: reclaims allocations (evidence: `README.md`)
- Game/client → Marker rewind: saves and rewinds (evidence: `README.md`)
- Game/client → Usage metrics: queries usage (evidence: `README.md`)
- Arena reset → Arena allocator: rewinds offset (evidence: `include/arena_allocator.h`)
- Marker rewind → Arena allocator: reads or sets offset (evidence: `include/arena_allocator.h`)
- Usage metrics → Arena allocator: reads size and offset (evidence: `include/arena_allocator.h`)
