pbr-cpp-memory-pool 1.1.2
Fixed-block-size O(1) memory pool — C++17 with an ANSI C public surface
Loading...
Searching...
No Matches
free_list_iterator.hpp File Reference

Read-only diagnostic Iterator over the pool's free list — ADR-0019. More...

#include <it/d4np/memorypool/memory_pool.h>
#include <it/d4np/memorypool/memory_pool.hpp>
#include <cstddef>
#include <iterator>

Go to the source code of this file.

Classes

class  it::d4np::memorypool::FreeListIterator
 Read-only LegacyForwardIterator over the free-list slots. More...
 
class  it::d4np::memorypool::FreeListView
 Lightweight read-only range over a pool's free list (ADR-0019 §3). More...
 

Detailed Description

Read-only diagnostic Iterator over the pool's free list — ADR-0019.

FreeListIterator is a LegacyForwardIterator that walks the implicit free list (ADR-0009 §1) yielding the address of each free slot; FreeListView is the range adaptor providing begin() / end(). The traversal is delegated to the memory_pool_debug_* C accessors so the free-list layout stays encapsulated behind the ADR-0010 Pimpl boundary.

The whole facility is gated behind PBR_MEMORY_POOL_DIAGNOSTICS (ADR-0019 §1) — available in debug builds, compiled out of release builds unless explicitly enabled. Header-only; adds zero object code and zero per-pool metadata.

Diagnostics-only: walking the list is O(free_count) and must never be used on the allocation hot path.

Definition in file free_list_iterator.hpp.