template <size_t Length>

class Buffer

Defined at line 107 of file ../../zircon/kernel/lib/heap/profile/include/lib/heap_profile.h

Page-aligned bump allocator with allocation, and offset-based data access.

Public Methods

std::span<const uint8_t> data ()

Returns a span pointing at the whole buffer.

Defined at line 110 of file ../../zircon/kernel/lib/heap/profile/include/lib/heap_profile.h

template <typename T>
std::optional<std::span<T>> allocate (size_t count)

Allocates a block of memory large enough to hold `count` objects of type `T`.

The memory is initialized to zero. Returns nullopt when there is not enough space available.

Defined at line 115 of file ../../zircon/kernel/lib/heap/profile/include/lib/heap_profile.h

template <typename T>
std::optional<std::span<T>> append (std::span<const T> value)

Extends the used part of the buffer with the given span of objects, and returns a span pointing

a the copy. Returns nullopt when there is not enough space available.

Defined at line 134 of file ../../zircon/kernel/lib/heap/profile/include/lib/heap_profile.h