diff --git a/xo-alloc2/docs/AAllocator-reference.rst b/xo-alloc2/docs/AAllocator-reference.rst index faa6f15a..4bb0150f 100644 --- a/xo-alloc2/docs/AAllocator-reference.rst +++ b/xo-alloc2/docs/AAllocator-reference.rst @@ -12,21 +12,44 @@ Context .. ditaa:: :--scale: 0.99 - +--------------------------------+ - | IAllocator_DArena | - +--------------------------------+ - | IAllocator_Xfer | - +--------------------------------+ - | IAllocator_ImplType | - +--------------+-----------------+ - |cBLU | DArena | - | AAllocator +-----------------+ - | | ArenaConfig | - +--------------+-----------------+ + +-------------------------------+--------------------------------------+ + | | IAllocator_DX1Collector | + | | IAllocIterator_DX1CollectorIterator | + | IAllocator_DArena | | + | IAllocIterator_DArenaIterator +--------------------------------------+ + | | DX1Collector | + | | DX1CollectorIterator | + | | | + +-------------------------------+---------+----------------------------+ + | DArena | | + | DArenaIterator | | + +-----------------------------------------+ CollectorConfig | + | ArenaConfig | | + +-----------------------------------------+----------------------------+ + + +----------------------------------+-----------------------------------+ + | RAllocator | RAllocIterator | + +----------------------------------+-----------------------------------+ + | IAllocator_DX1Collector | IAllocIterator_DX1Collector | + | IAllocator_DArena | IAllocIterator_DArena | + +----------------------------------+-----------------------------------+ + | IAllocator_Xfer | IAllocIterator_Xfer | + | IAllocator_Any | IAllocIterator_Any | + +----------------------------------+-----------------------------------+ + | AAllocator | AAllocIterator | + +----------------------------------+-----------------------------------+ + + +---------------+------------------+----------------------+------------+ + | | | AllocInfo | | + | generation | +----------------------+ | + | object_age | AllocError | AllocHeaderConfig | cmpresult | + | role | +----------------------+ | + | | | AllocHeader | | + +---------------+------------------+----------------------+------------+ .. code-block:: cpp - #incldue + #include Class ----- diff --git a/xo-alloc2/docs/DArena-reference.rst b/xo-alloc2/docs/DArena-reference.rst index 8ea46f98..8222f929 100644 --- a/xo-alloc2/docs/DArena-reference.rst +++ b/xo-alloc2/docs/DArena-reference.rst @@ -28,21 +28,44 @@ Context #include -Arena memory layout:: +Arena memory layout +.. code-block:: text - <----------------------------size--------------------------> - <------------committed-----------><-------uncommitted------> - <--allocated--> + <----------------------------size--------------------------> + <------------committed-----------><-------uncommitted------> + <--allocated--> - XXXXXXXXXXXXXXX___________________.......................... - ^ ^ ^ ^ - lo free limit hi + XXXXXXXXXXXXXXX___________________.......................... + ^ ^ ^ ^ + lo free limit hi - [X] allocated: in use - [_] committed: physical memory obtained - [.] uncommitted: mapped in virtual memory, not backed by memory + [X] allocated: in use + [_] committed: physical memory obtained + [.] uncommitted: mapped in virtual memory, not backed by memory +Allocation layout +.. code-block:: text + + free_(pre) + v + + <-------------z1---------------> + < guard >< hz >< req_z >< dz >< guard > + + used <== +++++++++0000zzzz@@@@@@@@@@@@@@@@@ppppppp+++++++++ ==> avail + + ^ ^ ^ + header mem | + ^ | + last_header_ free_(post) + + [+] guard after each allocation, for simple sanitize checks + [0] unused header bits (avail to application) + [z] record allocation size + [@] new allocated memory + [p] padding (to uintptr_t alignment) + Class ----- diff --git a/xo-alloc2/include/xo/alloc2/Collector.hpp b/xo-alloc2/include/xo/alloc2/Collector.hpp index f3523552..45c7fdb5 100644 --- a/xo-alloc2/include/xo/alloc2/Collector.hpp +++ b/xo-alloc2/include/xo/alloc2/Collector.hpp @@ -1,5 +1,5 @@ /** @file Collector.hpp -* + * * @author Roland Conybeare, Dec 2025 **/ diff --git a/xo-alloc2/include/xo/alloc2/arena/ArenaConfig.hpp b/xo-alloc2/include/xo/alloc2/arena/ArenaConfig.hpp index dcac455a..93fc35b8 100644 --- a/xo-alloc2/include/xo/alloc2/arena/ArenaConfig.hpp +++ b/xo-alloc2/include/xo/alloc2/arena/ArenaConfig.hpp @@ -6,7 +6,7 @@ #pragma once #include "alloc/AllocHeaderConfig.hpp" -#include "alloc/AllocError.hpp" +//#include "alloc/AllocError.hpp" #include #include diff --git a/xo-alloc2/include/xo/alloc2/arena/DArena.hpp b/xo-alloc2/include/xo/alloc2/arena/DArena.hpp index 36e87c4d..e44b6512 100644 --- a/xo-alloc2/include/xo/alloc2/arena/DArena.hpp +++ b/xo-alloc2/include/xo/alloc2/arena/DArena.hpp @@ -6,6 +6,7 @@ #pragma once #include "ArenaConfig.hpp" +#include "alloc/AllocError.hpp" #include "alloc/AllocInfo.hpp" namespace xo {