16#include "pw_allocator/block_allocator.h"
18namespace pw::allocator {
29template <
typename OffsetType = uintptr_t,
30 size_t kPoisonInterval = 0,
31 size_t kAlign =
alignof(OffsetType)>
51 BlockType* ChooseBlock(
Layout layout)
override {
53 BlockType* best =
nullptr;
54 for (
auto* block : Base::rblocks()) {
55 if (!block->CanAllocLast(layout).ok()) {
58 if (best ==
nullptr || block->OuterSize() < best->OuterSize()) {
62 if (best !=
nullptr && BlockType::AllocLast(best, layout).ok()) {
Definition: best_fit_block_allocator.h:33
constexpr BestFitBlockAllocator()
Constexpr constructor. Callers must explicitly call Init.
Definition: best_fit_block_allocator.h:39
BestFitBlockAllocator(ByteSpan region)
Definition: best_fit_block_allocator.h:47
Definition: block_allocator.h:79