From 72c4aaed02d0254253c5bd67f9ced1ac0e1a1b02 Mon Sep 17 00:00:00 2001 From: Abdelrahman Date: Sun, 10 May 2026 16:39:21 +0100 Subject: [PATCH] Update arena documentation --- os/Home.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/os/Home.md b/os/Home.md index 94abc69..951aee5 100644 --- a/os/Home.md +++ b/os/Home.md @@ -45,6 +45,8 @@ The commit flag behaviour varies by platform: A bump allocator backed by OS virtual memory (or a user-provided buffer). Provides fast sequential allocations with temporary scope support. +> **Prefer the arena-backed Allocator** — The library provides `wapp_mem_arena_allocator_init` which wraps an arena in the `Allocator` interface. Using this over raw arena functions is recommended for most use cases, as it is compatible with all data structures in the base package (arrays, lists, queues, strings) and provides a consistent API. + ### Initialization | Function / Macro | Description | @@ -107,7 +109,7 @@ Wraps an `Arena` in the `Allocator` interface from base. | `wapp_mem_arena_allocator_clear(allocator)` | Clear arena | | `wapp_mem_arena_allocator_destroy(allocator)` | Destroy arena | -> **Note:** The arena allocator only supports `alloc` and `alloc_aligned`. `realloc`, `realloc_aligned`, and `free` are not implemented (arenas do not support individual frees). +> **Note:** Only `free` is not implemented — arenas do not support individual deallocation. `alloc`, `alloc_aligned`, `realloc`, and `realloc_aligned` are all supported. ```c Allocator allocator = wapp_mem_arena_allocator_init(KiB(16));