Template Struct BlockTransactions

Struct Documentation

template<typename T>
struct BlockTransactions

Transactions over one retained CE::Memory::BlockManagement<T>::State.

All five collections are locked together. Replacement nodes are allocated before existing records change, then transferred with the same allocator and nonthrowing comparators. Backing allocation and final owner destruction happen outside these locks. Direct collection access still requires external quiescence and the same invariants. Included by block.h after its CE::Memory::Block hash specialization.

Public Types

using BlockType = ::CE::Memory::Block<T>
using State = typename ::CE::Memory::BlockManagement<T>::State
using Pool = std::set<BlockType, ::CE::Memory::Ordering::PoolOrder<T>>
using Sections = std::set<BlockType, ::CE::Memory::Ordering::HeadOrder<T>>
using Registry = std::set<BlockType, ::CE::Memory::Ordering::RegistryOrder<T>>
using Stale = std::unordered_map<BlockType, typename ::CE::Memory::BlockManagement<T>::tpoint>

Public Functions

inline ::CE::Memory::OptionalBlock<T> return_block(const std::shared_ptr<State> &state, const BlockType &block)
inline ::CE::Memory::OptionalBlock<T> return_range(const std::shared_ptr<State> &state, T *ptr, std::optional<std::size_t> count)
inline ::CE::Memory::OptionalBlock<T> find_section(const std::shared_ptr<State> &state, T *ptr)
inline ::CE::Memory::OptionalBlock<T> find_owner(const std::shared_ptr<State> &state, T *ptr)
inline ::CE::Memory::OptionalBlock<T> fill_request(const std::shared_ptr<State> &state, std::size_t count, std::align_val_t alignment)

Public Static Functions

template<typename Allocate>
static inline BlockType checkout(const std::shared_ptr<State> &state, std::size_t count, std::align_val_t alignment, Allocate allocate)
static inline void register_free(const std::shared_ptr<State> &state, const BlockType &block)
static inline void record_new(const std::shared_ptr<State> &state, const BlockType &block)
static inline void mark_stale(const std::shared_ptr<State> &state, const BlockType &block)
static inline void cull(const std::shared_ptr<State> &state, std::chrono::minutes age)
static inline void release_culled(const std::shared_ptr<State> &state)