#include <detailed_block.h>
Public Types | |
using | OffsetType = typename Parameters::OffsetType |
using | Range = typename IterableBlock< BlockType >::Range |
using | Iterator = typename IterableBlock< BlockType >::Iterator |
Additional Inherited Members | |
![]() | |
BasicBlock (const BasicBlock &other)=delete | |
BasicBlock & | operator= (const BasicBlock &other)=delete |
constexpr std::byte * | UsableSpace () |
constexpr const std::byte * | UsableSpace () const |
constexpr std::byte * | UsableSpaceUnchecked () |
constexpr const std::byte * | UsableSpaceUnchecked () const |
constexpr size_t | OuterSize () const |
constexpr size_t | InnerSize () const |
constexpr size_t | InnerSizeUnchecked () const |
constexpr bool | IsValid () const |
constexpr bool | CheckInvariants () const |
Like IsValid , but crashes if invalid. | |
![]() | |
constexpr DetailedBlockImpl< Parameters > * | Prev () const |
constexpr DetailedBlockImpl< Parameters > * | Next () const |
![]() | |
constexpr bool | IsFree () const |
constexpr bool | Used () const |
constexpr StatusWithSize | CanAlloc (Layout layout) const |
constexpr BlockResult< DetailedBlockImpl< Parameters > > | Resize (size_t new_inner_size) |
![]() | |
constexpr Layout | RequestedLayout () const |
![]() | |
constexpr uintptr_t | GetPoisonWord () const |
Returns the value written to a block's usable space when poisoning. | |
constexpr bool | IsPoisoned () const |
Returns whether this block has been poisoned. | |
constexpr void | Poison () |
![]() | |
static constexpr Result< DetailedBlockImpl< Parameters > * > | Init (ByteSpan region) |
Creates the first block for a given memory region. | |
static constexpr internal::copy_const_ptr_t< Ptr, DetailedBlockImpl< Parameters > * > | FromUsableSpace (Ptr usable_space) |
static constexpr size_t | OuterSizeFromInnerSize (size_t inner_size) |
static constexpr size_t | InnerSizeFromOuterSize (size_t outer_size) |
![]() | |
static constexpr BlockResult< DetailedBlockImpl< Parameters > > | AllocFirst (DetailedBlockImpl< Parameters > *&&block, Layout layout) |
static constexpr BlockResult< DetailedBlockImpl< Parameters > > | AllocLast (DetailedBlockImpl< Parameters > *&&block, Layout layout) |
static constexpr BlockResult< DetailedBlockImpl< Parameters > > | Free (DetailedBlockImpl< Parameters > *&&block) |
![]() | |
static constexpr size_t | kAlignment |
static constexpr size_t | kBlockOverhead |
static constexpr size_t | kMinOuterSize |
![]() | |
static constexpr size_t | kPoisonOffset |
![]() | |
constexpr bool | DoCheckInvariants (bool strict) const |
![]() | |
constexpr DetailedBlockImpl< Parameters > * | DoSplitFirst (size_t new_inner_size) |
constexpr DetailedBlockImpl< Parameters > * | DoSplitLast (size_t new_inner_size) |
constexpr void | DoMergeNext () |
constexpr bool | DoCheckInvariants (bool strict) const |
Performs the ContiguousBlock invariant checks. | |
![]() | |
constexpr StatusWithSize | DoCanAlloc (Layout layout) const |
constexpr BlockResult< DetailedBlockImpl< Parameters > > | DoResize (size_t new_inner_size, bool shifted=false) |
![]() | |
constexpr StatusWithSize | DoCanAlloc (Layout layout) const |
![]() | |
constexpr BlockResult< DetailedBlockImpl< Parameters > > | DoResize (size_t new_inner_size, bool shifted=false) |
![]() | |
constexpr uintptr_t | DoGetPoisonWord () const |
constexpr DetailedBlockImpl< Parameters > * | DoSplitFirst (size_t new_inner_size) |
constexpr DetailedBlockImpl< Parameters > * | DoSplitLast (size_t new_inner_size) |
constexpr void | DoMergeNext () |
constexpr bool | DoCheckInvariants (bool strict) const |
Like IsValid , but crashes if invalid. | |
constexpr void | SetFree (bool is_free) |
Clears the poisoned state if a block is not free. | |
![]() | |
static constexpr BlockResult< DetailedBlockImpl< Parameters > > | DoAllocFirst (DetailedBlockImpl< Parameters > *&&block, Layout layout) |
static constexpr BlockResult< DetailedBlockImpl< Parameters > > | DoAllocLast (DetailedBlockImpl< Parameters > *&&block, Layout layout) |
static constexpr BlockResult< DetailedBlockImpl< Parameters > > | DoFree (DetailedBlockImpl< Parameters > *&&block) |
![]() | |
static constexpr BlockResult< DetailedBlockImpl< Parameters > > | DoAllocFirst (DetailedBlockImpl< Parameters > *&&block, Layout layout) |
static constexpr BlockResult< DetailedBlockImpl< Parameters > > | DoAllocLast (DetailedBlockImpl< Parameters > *&&block, Layout layout) |
![]() | |
static constexpr BlockResult< DetailedBlockImpl< Parameters > > | DoAllocFirst (DetailedBlockImpl< Parameters > *&&block, Layout layout) |
static constexpr BlockResult< DetailedBlockImpl< Parameters > > | DoAllocLast (DetailedBlockImpl< Parameters > *&&block, Layout layout) |
static constexpr BlockResult< DetailedBlockImpl< Parameters > > | DoFree (DetailedBlockImpl< Parameters > *&&block) |
A block implementation that implements most optional block mix-ins.
This block dervies from various block mix-ins, allowing it to perform aligned allocations, iterate over blocks, poison and check free blocks, retrieve requested memory layouts, and more.
The amount of memory that can be addressed by a block of this type depends on it given OffsetType
. This type is used to describe the size of both the current and previous block, so the maximum addressable range is given by std::numeric_limits<OffsetType> * alignof(OffsetType)
.
An additional 4 bytes are used to store details about an allocation, including whether it is in use or free, whether it is poisoned, and what the originally requested layout for a block was.
See also the DetailedBlock
alias which provides the Parameters
type automatically.
Parameters | Block traits, such as DetailedBlockParameters , which encapsulate a set of template parameters. |