Container of free blocks sorted in order of decreasing size.
As noted in the base class, this class relies on a forward list. This allows the free blocks to be as small as a single pointer, but makes insertion and lookup O(n) on the number of blocks in the bucket.
Calling RemoveAny() on this bucket will return the largest free block.
Additional Inherited Members | |
Public Types inherited from pw::allocator::internal::BucketBase< Derived, BlockType_, ItemType_ > | |
| using | BlockType = BlockType_ |
| using | ItemType = ItemType_ |
Public Member Functions inherited from pw::allocator::internal::BucketBase< Derived, BlockType_, ItemType_ > | |
| constexpr bool | empty () const |
| Returns whether this buckets contains any free blocks. | |
| constexpr size_t | max_inner_size () const |
| Returns the configured maximum inner size for blocks in this bucket. | |
| constexpr void | set_max_inner_size (size_t max_inner_size) |
| bool | Add (BlockType &block) |
| const BlockType * | FindLargest () const |
| BlockType * | RemoveAny () |
| bool | Remove (BlockType &block) |
| BlockType * | RemoveCompatible (Layout layout) |
| void | Clear () |
| Removes all blocks from this bucket. | |
Protected Types inherited from pw::allocator::internal::SortedBucketBase< ReverseSortedBucket< BlockType >, BlockType > | |
| using | Base = BucketBase< ReverseSortedBucket< BlockType >, BlockType, SortedItem > |
Protected Member Functions inherited from pw::allocator::internal::SortedBucketBase< ReverseSortedBucket< BlockType >, BlockType > | |
| const IntrusiveForwardList< SortedItem > & | items () const |
| void | DoAdd (BlockType &block) |
| BlockType * | DoRemoveAny () |
| bool | DoRemove (BlockType &block) |
| BlockType * | DoRemoveCompatible (Layout layout) |
Static Protected Member Functions inherited from pw::allocator::internal::BucketBase< Derived, BlockType_, ItemType_ > | |
| template<typename Iterator , typename Predicate > | |
| static Iterator | FindPrevIf (Iterator before_first, Iterator last, Predicate predicate) |
| static auto | MakeCanAllocPredicate (Layout layout) |
| static bool | Compare (const ItemType &item1, const ItemType &item2) |
| template<typename Iterator > | |
| static constexpr BlockType * | GetBlockFromIterator (Iterator iter, Iterator last) |
| template<typename Iterator > | |
| static constexpr BlockType * | GetBlockFromPrev (Iterator prev, Iterator last) |
| static ItemType & | GetItemFrom (BlockType &block) |
Protected Attributes inherited from pw::allocator::internal::SortedBucketBase< ReverseSortedBucket< BlockType >, BlockType > | |
| friend | Base |