16#include "pw_allocator/block_allocator.h"
18namespace pw::allocator {
28template <
typename OffsetType = uintptr_t,
29 size_t kPoisonInterval = 0,
30 size_t kAlign =
alignof(OffsetType)>
50 BlockType* ChooseBlock(
Layout layout)
override {
52 BlockType* worst =
nullptr;
53 for (
auto* block : Base::rblocks()) {
54 if (!block->CanAllocLast(layout).ok()) {
57 if (worst ==
nullptr || block->OuterSize() > worst->OuterSize()) {
61 if (worst !=
nullptr && BlockType::AllocLast(worst, layout).ok()) {
Definition: block_allocator.h:79
Definition: worst_fit_block_allocator.h:32
WorstFitBlockAllocator(ByteSpan region)
Definition: worst_fit_block_allocator.h:46
constexpr WorstFitBlockAllocator()
Constexpr constructor. Callers must explicitly call Init.
Definition: worst_fit_block_allocator.h:38