18#include "pw_allocator/bucket/base.h"
19#include "pw_containers/intrusive_forward_list.h"
21namespace pw::allocator {
39template <
typename BlockType>
44 using Base = internal::
45 BucketBase<UnorderedBucket<BlockType>, BlockType,
UnorderedItem>;
53 void DoAdd(BlockType& block) {
55 items_.push_front(*item);
59 BlockType* DoRemoveAny() {
62 return BlockType::FromUsableSpace(&item);
66 bool DoRemove(BlockType& block) {
71 BlockType* DoRemoveCompatible(
Layout layout) {
76 if (block !=
nullptr) {
77 items_.erase_after(prev);
Definition: intrusive_forward_list.h:86
Definition: unordered.h:42
Definition: unordered.h:30
static auto MakeCanAllocPredicate(Layout layout)
Definition: base.h:157
constexpr BlockType * GetBlockFromPrev(Iterator prev, Iterator last)
Definition: base.h:174
void Clear()
Removes all blocks from this bucket.
Definition: base.h:124
static ItemType & GetItemFrom(BlockType &block)
Definition: base.h:185
static Iterator FindPrevIf(Iterator before_first, Iterator last, Predicate predicate)
Definition: base.h:138