Template Struct Block

Struct Documentation

template<typename T>
struct Block

A contiguous range within one backing allocation.

owner keeps that allocation alive; head may point into it after a split. length counts T objects (bytes for void). Splitting produces ranges with the same owner without transferring storage. Range mutation requires caller synchronization and valid representable backing bounds. Compound registry/pool transitions use CE::Memory::BlockTransactions instead.

Public Types

using spointer = std::shared_ptr<T>
using OBlock = std::optional<Block>

Public Functions

OBlock split_exactly(std::size_t idx)
OBlock split_at(std::size_t idx)
bool contains(void *p) const
inline std::vector<spointer> vector(std::function<void(T*)> d)

Public Members

spointer owner = {nullptr}
spointer head = {nullptr}
std::align_val_t alignment = {}
std::size_t length = 1