20#include "pw_allocator/allocator.h"
21#include "pw_bytes/span.h"
22#include "pw_multibuf/chunk.h"
23#include "pw_multibuf/config.h"
25namespace pw::multibuf {
47 if (tracker ==
nullptr) {
51 if (!chunk.has_value()) {
69 allocator::Layout::Of<HeaderChunkRegionTracker>().Extend(size);
84 std::byte* ptr =
reinterpret_cast<std::byte*
>(
this);
86 std::destroy_at(
this);
87 alloc->Deallocate(ptr);
91 return alloc_->Allocate(allocator::Layout::Of<Chunk>());
103 : region_(region), alloc_(&alloc) {}
Definition: allocator.h:36
void * Allocate(Layout layout)
Definition: allocator.h:44
std::optional< OwnedChunk > CreateFirstChunk()