ArenaConfig Reference
Configuration for an arena allocator
Context
example arena config
#include <xo/arena/ArenaConfig.hpp>
Class
Instance Variables
- group ArenaConfig members
Variables
-
MemoryNameStr name_
optional name, for diagnostics
-
std::size_t size_ = 0
desired arena size — hard max = reserved virtual memory
-
std::size_t base_align_z_ = 0
desired alignment for this arena’s BASE address. 0 for the page/hugepage default.
Allow recovering an arena’s base from any pointer in that arena, by masking off the low-order
base_align_z_-1bits. This is sound only ifSee with_base_align_z.size_ <= base_align_z_
-
bool exclusive_block_flag_ = false
when base_align_z_ > 0: true to reserve the whole base_align_z_ block rather than just size_. Applies to address space, not committed memory. Ignored when base_align_z_ is zero.
See with_exclusive_block_flag.
-
std::size_t hugepage_z_ = 2 * 1024 * 1024
hugepage size — using huge pages relieves some TLB pressure (provided you use their full extent :)
-
bool store_header_flag_ = false
true to store header (8 bytes) at the beginning of each allocation. necessary and sufficient to allows iterating over allocs present in arena.
-
AllocHeaderConfig header_ = {}
configuration for per-alloc header
-
bool debug_flag_ = false
true to enable debug logging
-
MemoryNameStr name_
