class DurableBuffer

Defined at line 13 of file ../../zircon/system/ulib/trace-engine/buffer.h

A buffer that, once created and DurableBuffer::Set, can concurrently allocate data to multiple

writers until it becomes full.

Public Members

static const size_t kMinDurableBufferSize
static const size_t kMaxDurableBufferSize

Public Methods

void Set (std::span<uint8_t> data)

Configure the DurableBuffer to write to the given span.

Defined at line 12 of file ../../zircon/system/ulib/trace-engine/buffer.cc

uint64_t * AllocRecord (size_t num_bytes)

Allocate data from the configured buffer. Thread safe.

Defined at line 21 of file ../../zircon/system/ulib/trace-engine/buffer.cc

size_t BytesAllocated ()

Return the total number of allocated bytes.

Defined at line 8 of file ../../zircon/system/ulib/trace-engine/buffer.cc

size_t MaxSize ()

Return the total underlying buffer size (allocated and unallocated).

Defined at line 17 of file ../../zircon/system/ulib/trace-engine/buffer.cc

void Reset ()

Set the allocation pointer back to the beginning of the buffer.

Defined at line 19 of file ../../zircon/system/ulib/trace-engine/buffer.cc