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
it::d4np::memorypool::FreeListView Class Reference

Lightweight read-only range over a pool's free list (ADR-0019 §3). More...

#include <free_list_iterator.hpp>

Public Member Functions

 FreeListView (const memory_pool_t *pool) noexcept
 View the free list of pool (a C handle), or an empty range if NULL.
 
 FreeListView (Pool &pool) noexcept
 View the free list of pool — ergonomic overload for the C++ wrapper.
 
FreeListIterator begin () const noexcept
 
FreeListIterator end () const noexcept
 

Detailed Description

Lightweight read-only range over a pool's free list (ADR-0019 §3).

The entry point for the diagnostic walk:

for (const void* slot : FreeListView{pool}) {
// inspect slot
}
const auto free = std::distance(FreeListView{pool}.begin(),
FreeListView{pool}.end());
Lightweight read-only range over a pool's free list (ADR-0019 §3).
FreeListIterator begin() const noexcept

Holds only a const memory_pool_t*; constructing it neither allocates nor walks. The view does not own the pool and must not out-live it.

Definition at line 121 of file free_list_iterator.hpp.

Constructor & Destructor Documentation

◆ FreeListView() [1/2]

it::d4np::memorypool::FreeListView::FreeListView ( const memory_pool_t pool)
inlineexplicitnoexcept

View the free list of pool (a C handle), or an empty range if NULL.

Definition at line 124 of file free_list_iterator.hpp.

◆ FreeListView() [2/2]

it::d4np::memorypool::FreeListView::FreeListView ( Pool pool)
inlineexplicitnoexcept

View the free list of pool — ergonomic overload for the C++ wrapper.

Definition at line 127 of file free_list_iterator.hpp.

Member Function Documentation

◆ begin()

FreeListIterator it::d4np::memorypool::FreeListView::begin ( ) const
inlinenoexcept
Returns
Iterator at the head of the free list (ADR-0019 §2).

Definition at line 130 of file free_list_iterator.hpp.

◆ end()

FreeListIterator it::d4np::memorypool::FreeListView::end ( ) const
inlinenoexcept
Returns
End sentinel. The null current_ is what marks the end (equality compares only the current slot), so this equals a default-constructed FreeListIterator; carrying pool_ keeps the two iterators of a range mutually consistent.

Definition at line 140 of file free_list_iterator.hpp.


The documentation for this class was generated from the following file: