Mix-in for blocks that collectively represent a contiguous region of memory.
Contiguous blocks can be split into smaller blocks and merged when adjacent.
Block mix-ins are stateless and trivially constructible. See BasicBlock for details on how mix-ins can be combined to implement blocks.
This mix-in requires its derived type also derive from BasicBlock, and provide the following symbols:
kAlignment.
Public Member Functions | |
| constexpr Derived * | Prev () const |
| constexpr Derived * | Next () const |
Protected Member Functions | |
| constexpr Derived * | DoSplitFirst (size_t new_inner_size) |
| constexpr Derived * | DoSplitLast (size_t new_inner_size) |
| constexpr void | DoMergeNext () |
| constexpr bool | DoCheckInvariants (bool strict) const |
| Performs the ContiguousBlock invariant checks. | |
Friends | |
| template<typename > | |
| class | PoisonableBlock |
|
constexprprotected |
Merges this block with next block.
This method is static in order to consume and replace the given block pointer with a pointer to the new, larger block.
|
constexprprotected |
Split a block into two smaller blocks.
This method splits a block into a leading block of the given new_inner_size and a trailing block, and returns the trailing space as a new block.
|
constexprprotected |
Split a block into two smaller blocks.
This method splits a block into a leading block and a trailing block of the given new_inner_size, and returns the trailing space is returned as a new block.
|
constexpr |
|
constexpr |