![]() |
Lumiera 0.pre.04~rc.1
»edit your freedom«
|
#include "vault/mem/extent-family.hpp"
Memory manager to provide a sequence of Extents for cyclic usage.
Storage extents, once allocated, will be re-used without invoking any ctors or dtors on the objects nominally located in »slots« within the Extent.
Definition at line 71 of file extent-family.hpp.
Classes | |
| struct | Extent |
| logical structure of a memory Extent More... | |
| struct | IdxLink |
| Iteration »State Core« based on Extents index position. More... | |
| struct | Storage |
| Entry in the Extents management datastructure. More... | |
Public Types | |
| using | iterator = lib::IterableDecorator< IdxLink > |
| allow transparent iteration of Extents, with the ability to expand storage | |
Public Member Functions | |
| ExtentFamily (size_t initialCnt=1) | |
| void | reserve (size_t expectedMaxExtents) |
| void | openNew (size_t cnt=1) |
| claim next cnt extents, possibly allocate. | |
| void | dropOld (size_t cnt) |
| discard oldest cnt extents | |
| iterator | begin () |
| iterate over all the currently active Extents | |
| iterator | end () |
| bool | empty () const |
| iterator | last () |
| positioned to the last / latest storage extent opened | |
Friends | |
| class | ExtentDiagnostic< T, siz > |
| „backdoor“ to watch internals from tests | |
| iterator | begin (ExtentFamily &exFam) |
| iterator | end (ExtentFamily &exFam) |
Private Types | |
| using | _UniqueStoragePtr = std::unique_ptr< lib::UninitialisedStorage< T, siz > > |
| using | Extents = std::vector< Storage > |
Private Member Functions | |
| bool | isWrapped () const |
| size_t | slotCnt () const |
| size_t | activeSlotCnt () const |
| size_t | freeSlotCnt () const |
| bool | canAccomodate (size_t addCnt) const |
| size_t | incWrap (size_t idx, size_t inc=1) |
| increment index, but wrap at array end. | |
| bool | isValidPos (size_t idx) const |
| bool | matchPos (size_t idx, void *address) |
| Extent & | access (size_t idx) const |
| void | ___sanityCheckAllocSize (size_t addCnt) |
Private Member Functions inherited from NonCopyable | |
| ~NonCopyable ()=default | |
| NonCopyable ()=default | |
| NonCopyable (NonCopyable const &)=delete | |
| NonCopyable & | operator= (NonCopyable const &)=delete |
Private Attributes | |
| Extents | extents_ |
| size_t | start_ |
| size_t | after_ |
Static Private Attributes | |
| static const size_t | EXCESS_ALLOC {5} |
| number of excess new extents to add whenever new storage is required | |
|
inlineexplicit |
Definition at line 203 of file extent-family.hpp.
|
private |
Definition at line 90 of file extent-family.hpp.
Definition at line 115 of file extent-family.hpp.
| using iterator = lib::IterableDecorator<IdxLink> |
allow transparent iteration of Extents, with the ability to expand storage
Definition at line 260 of file extent-family.hpp.
|
inline |
Definition at line 210 of file extent-family.hpp.
References ExtentFamily< T, siz >::extents_.
|
inline |
claim next cnt extents, possibly allocate.
Definition at line 223 of file extent-family.hpp.
References ExtentFamily< T, siz >::___sanityCheckAllocSize(), ExtentFamily< T, siz >::after_, ExtentFamily< T, siz >::canAccomodate(), ExtentFamily< T, siz >::EXCESS_ALLOC, ExtentFamily< T, siz >::extents_, ExtentFamily< T, siz >::freeSlotCnt(), ExtentFamily< T, siz >::incWrap(), ExtentFamily< T, siz >::isWrapped(), ExtentFamily< T, siz >::last(), ExtentFamily< T, siz >::slotCnt(), and ExtentFamily< T, siz >::start_.
Referenced by ExtentFamily< T, siz >::IdxLink::expandAlloc(), ExtentFamily_test::reuseUnclean(), and BlockFlow< CONF >::until().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
discard oldest cnt extents
Definition at line 251 of file extent-family.hpp.
References ExtentFamily< T, siz >::activeSlotCnt(), ExtentFamily< T, siz >::incWrap(), and ExtentFamily< T, siz >::start_.
Referenced by BlockFlow< CONF >::discardBefore().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
iterate over all the currently active Extents
Definition at line 263 of file extent-family.hpp.
References ExtentFamily< T, siz >::start_.
Referenced by BlockFlow< CONF >::allEpochs(), BlockFlow< CONF >::firstEpoch(), and BlockFlow< CONF >::until().
Here is the caller graph for this function:
|
inline |
Definition at line 264 of file extent-family.hpp.
References ExtentFamily< T, siz >::after_.
Referenced by BlockFlow< CONF >::until().
Here is the caller graph for this function:
|
inline |
Definition at line 270 of file extent-family.hpp.
References ExtentFamily< T, siz >::after_, and ExtentFamily< T, siz >::start_.
Referenced by ExtentFamily< T, siz >::last().
Here is the caller graph for this function:
|
inline |
positioned to the last / latest storage extent opened
Definition at line 276 of file extent-family.hpp.
References ExtentFamily< T, siz >::after_, ExtentFamily< T, siz >::empty(), ExtentFamily< T, siz >::incWrap(), and ExtentFamily< T, siz >::slotCnt().
Referenced by BlockFlow< CONF >::lastEpoch(), and ExtentFamily< T, siz >::openNew().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlineprivate |
Definition at line 286 of file extent-family.hpp.
References ExtentFamily< T, siz >::after_, and ExtentFamily< T, siz >::start_.
Referenced by ExtentFamily< T, siz >::activeSlotCnt(), ExtentFamily< T, siz >::isValidPos(), and ExtentFamily< T, siz >::openNew().
Here is the caller graph for this function:
|
inlineprivate |
Definition at line 292 of file extent-family.hpp.
References ExtentFamily< T, siz >::extents_.
Referenced by ExtentFamily< T, siz >::___sanityCheckAllocSize(), ExtentFamily< T, siz >::activeSlotCnt(), ExtentFamily< T, siz >::freeSlotCnt(), ExtentFamily< T, siz >::incWrap(), ExtentFamily< T, siz >::isValidPos(), ExtentFamily< T, siz >::last(), ExtentFamily< T, siz >::matchPos(), and ExtentFamily< T, siz >::openNew().
Here is the caller graph for this function:
|
inlineprivate |
Definition at line 299 of file extent-family.hpp.
References ExtentFamily< T, siz >::after_, ExtentFamily< T, siz >::isWrapped(), ExtentFamily< T, siz >::slotCnt(), and ExtentFamily< T, siz >::start_.
Referenced by ExtentFamily< T, siz >::dropOld(), ExtentFamily< T, siz >::freeSlotCnt(), and ExtentFamily< T, siz >::isValidPos().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlineprivate |
Definition at line 310 of file extent-family.hpp.
References ExtentFamily< T, siz >::activeSlotCnt(), and ExtentFamily< T, siz >::slotCnt().
Referenced by ExtentFamily< T, siz >::canAccomodate(), and ExtentFamily< T, siz >::openNew().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlineprivate |
Definition at line 318 of file extent-family.hpp.
References ExtentFamily< T, siz >::freeSlotCnt().
Referenced by ExtentFamily< T, siz >::openNew().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlineprivate |
increment index, but wrap at array end.
Definition at line 328 of file extent-family.hpp.
References ExtentFamily< T, siz >::slotCnt().
Referenced by ExtentFamily< T, siz >::dropOld(), ExtentFamily< T, siz >::IdxLink::iterNext(), ExtentFamily< T, siz >::last(), and ExtentFamily< T, siz >::openNew().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlineprivate |
Definition at line 334 of file extent-family.hpp.
References ExtentFamily< T, siz >::activeSlotCnt(), ExtentFamily< T, siz >::after_, ExtentFamily< T, siz >::isWrapped(), ExtentFamily< T, siz >::slotCnt(), and ExtentFamily< T, siz >::start_.
Referenced by ExtentFamily< T, siz >::access(), and ExtentFamily< T, siz >::IdxLink::expandAlloc().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlineprivate |
Definition at line 345 of file extent-family.hpp.
References ExtentFamily< T, siz >::extents_, and ExtentFamily< T, siz >::slotCnt().
Referenced by ExtentFamily< T, siz >::IdxLink::validatePos().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlineprivate |
Definition at line 352 of file extent-family.hpp.
References ExtentFamily< T, siz >::isValidPos().
Referenced by ExtentFamily< T, siz >::IdxLink::yield().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlineprivate |
Definition at line 359 of file extent-family.hpp.
References util::showSize(), and ExtentFamily< T, siz >::slotCnt().
Referenced by ExtentFamily< T, siz >::openNew().
Here is the call graph for this function:
Here is the caller graph for this function:
|
staticprivate |
number of excess new extents to add whenever new storage is required
Definition at line 76 of file extent-family.hpp.
Referenced by ExtentFamily< T, siz >::openNew().
|
private |
Definition at line 198 of file extent-family.hpp.
Referenced by ExtentFamily< T, siz >::matchPos(), ExtentFamily< T, siz >::openNew(), ExtentFamily< T, siz >::reserve(), and ExtentFamily< T, siz >::slotCnt().
|
private |
Definition at line 199 of file extent-family.hpp.
Referenced by ExtentFamily< T, siz >::activeSlotCnt(), ExtentFamily< T, siz >::begin(), ExtentFamily< T, siz >::dropOld(), ExtentFamily< T, siz >::empty(), ExtentFamily< T, siz >::IdxLink::expandAlloc(), ExtentFamily< T, siz >::isValidPos(), ExtentFamily< T, siz >::isWrapped(), and ExtentFamily< T, siz >::openNew().
|
private |
Definition at line 199 of file extent-family.hpp.
Referenced by ExtentFamily< T, siz >::activeSlotCnt(), ExtentFamily< T, siz >::IdxLink::checkPoint(), ExtentFamily< T, siz >::empty(), ExtentFamily< T, siz >::end(), ExtentFamily< T, siz >::isValidPos(), ExtentFamily< T, siz >::isWrapped(), ExtentFamily< T, siz >::last(), and ExtentFamily< T, siz >::openNew().
|
friend |
„backdoor“ to watch internals from tests
Definition at line 359 of file extent-family.hpp.
|
friend |
Definition at line 266 of file extent-family.hpp.
|
friend |
Definition at line 267 of file extent-family.hpp.
Inheritance diagram for ExtentFamily< T, siz >:
Collaboration diagram for ExtentFamily< T, siz >: